[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: <span class="underline"> should be <em>

From: Tim Cross
Subject: Re: <span class="underline"> should be <em>
Date: Sat, 17 Oct 2020 09:46:08 +1100
User-agent: mu4e 1.5.5; emacs 28.0.50

This one is a little 'tricky'. The <em> tag means emphasis and is not
the same as underline (browsers are free to 'interpret' emphasis as
anything which will emphasise the text from surrounding text, which
could be bold, italic, underline or a combination. If we changed
underline to <em> tags, I'm sure we would get a post about text not
being underlined in html export.

There use to be a <u> tag for underline, but that has been replaced by
'unarticulated text' and it is recommended to now use CSS text
decoration properties to do underline.

On the other hand, I don't think Emacs' EWW/shr support the CSS text
decoration properties, so I'm not sure if you will get underlined text
when viewing org HTML in Emacs EWW.

The real challenge here is in how to map org mode specific attributes
such as italic, underline and bold to HTML's semantic tags of <em>,
<strong> etc. In hindsight, it probably would have been better for org
to have used sematnic markup types, leaving it to each exporter to
interpret how the different semantic types map to character types.

One solution could be to make all of them CSS classes, have a default
CSS for italic, bold, underline, code etc. Users could then add their
own CSS to render each as they preferred when not happy with the defaults. 

Pankaj Jangid <pankaj@codeisgreat.org> writes:

> For this org mode text:
> #+begin_src org
> - This text is /emphasized/
> - This text is *in bold*
> - This text is _underlined_
> - This text uses =a teletype font=
> #+end_src
> the follow is the HTML output:
> #+begin_src
> <ul class="org-ul">
> <li>This text is <i>emphasized</i></li>
> <li>This text is <b>in bold</b></li>
> <li>This text is <span class="underline">underlined</span></li>
> <li>This text uses <code>a teletype font</code></li>
> </ul>
> #+end_src
> In case of /italics/, CSS class is used whereas for other formatting
> cases native HTML elements are used. Shouldn't the _underline_ be
> converted into <em> tags?
> Regards

Tim Cross

reply via email to

[Prev in Thread] Current Thread [Next in Thread]