public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Gwern Branwen <gwern-v26ZT+9V8bxeoWH0uzbU5w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Should the HTML writer generate empty '<span>' elements?
Date: Sat, 4 Sep 2021 19:15:13 -0400	[thread overview]
Message-ID: <CAMwO0gyKnt3aaaGqM_D61ttQOM0v4iz2uHM3RtW9pgkiO+fWXg@mail.gmail.com> (raw)
In-Reply-To: <543ae04c-c5ef-99c3-cff7-15068893b3e4-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Sat, Sep 4, 2021 at 6:49 PM MarLinn <monkleyon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> There's probably a lot more, these are just some cases I thought of.

Most of your cases appear to require IDs, classes, or attributes: #2,
#3, #4 (you're not going to just 'background image' *every* span in
the page can you?), possibly #5; I'm not sure about #1 'clearfix' or
#7 'count of elements' (how does that work?), and #8 is too vague for
me to comment on.

> Is an empty span always the best solution to these problems? Probably not. But sometimes it is.

Have you run into an actual case? It seems like it must be quite rare
given how many tools warn or delete empty spans already, and I didn't
find anyone complaining about how they genuinely needed them because
all the alternatives were worse.

> The most relevant as it relates to pandoc is probably the third one: in a pandoc filter. Because of that I would not want to see this feature be removed.

Can you give an example of a Pandoc filter where an empty Span or
completely empty Span would be useful? Also, why would a filter care
about the compiled HTML not having empty '<span></span>'s in it? It'd
be doing all its work before the HTML writer is ever called. Any kind
of tagging or marking is finished well before.

> Now, should the span be self-closing? That's a different question. I suspect that that's the main reason for many/all of the errors you're seeing, not the pure empty-ness. So that might be something worth changing. But as you're saying, that's a Hakyll problem, not a Pandoc problem.

Well, I should clarify that I *think* it's a Hakyll problem simply
because the standard Pandoc settings on the CLI and ghci don't seem to
produce self-closed tags but I get them in the final generated HTML; I
haven't looked into it in more detail to figure out where the
self-closing happens because I couldn't convince myself that writing
out empty spans is even desirable in the first place (so what happens
further downstream may be moot).

-- 
gwern
https://www.gwern.net

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAMwO0gyKnt3aaaGqM_D61ttQOM0v4iz2uHM3RtW9pgkiO%2BfWXg%40mail.gmail.com.


  parent reply	other threads:[~2021-09-04 23:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-04 16:08 Gwern Branwen
     [not found] ` <CAMwO0gywhE+u4wgaL0sieohjuqAm+VM2Lj489EsQST74FMqrMA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-09-04 22:49   ` MarLinn
     [not found]     ` <543ae04c-c5ef-99c3-cff7-15068893b3e4-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2021-09-04 23:15       ` Gwern Branwen [this message]
     [not found]         ` <CAMwO0gyKnt3aaaGqM_D61ttQOM0v4iz2uHM3RtW9pgkiO+fWXg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-09-05  0:51           ` MarLinn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMwO0gyKnt3aaaGqM_D61ttQOM0v4iz2uHM3RtW9pgkiO+fWXg@mail.gmail.com \
    --to=gwern-v26zt+9v8bxeowh0uzbu5w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).