The current way to underline text in Asciidoctor is:
+++underline me+++ renders as underlined text.
pass:[underline me] also renders as underlined text.
Why do we need to have 2 ways to generate Italics?
'Italic'
Single quotes around a word or phrase makes it italic.
_Italic_
One underscore (_) on either side of a word or phrase also makes it italic.
I think that _ underscore makes more sense as underline.
I would like a way to be able to render _text_ as text in the output.
Maybe a variable at the beginning of the document :underscore_as_underline: that tells the processor to do it this way (as not to break current functionality).
I've thought about this proposal and I disagree with it for several reasons.
The most significant argument against the proposal is that the use of underline for anything other than a hyperlink in digital publishing is considered deprecated and generally discouraged. Underlined text came into use as a formatting mark for emphasis as a workaround since typewriters had no bold or italic styling capabilities. It was never meant to appear in the final draft. (See http://practicaltypography.com/underlining.html)
All the major style guides (Chicago, New York) explicitly advise against the use of the underline, labeling it as legacy, and the HTML5 specification discourage its use in normal text to avoid confusion with hyperlinks. Text should be emphasized using italics (preferred), bold (used sparingly) or an alternative styling that is still accessible.
I'm also opposed to the use of underscore for underline because this pulls us away from our goal of aligning with Markdown where we can. The two formatting marks in Markdown for italicizing text is the asterisk or the underscore. AsciiDoc already uses the asterisk for bold, so we can't change that. Thus, if we are dropping one of the formatting marks for italicizing text in AsciiDoc, it needs to be the single quote, not the underscore.
If you still want to underline text, perhaps because you're referring to an example of the underline text-decoration in use, you should do it by assigning a role to a span of text:
[.underline]#underline me#
which converts to the following HTML:
<span class="underline">underline me</span>
This is already supported in the default AsciiDoc stylesheet.
Note that it's also possible to style text using overline and line-through in a similar fashion:
[.line-through]#strike to the heart!#
[.overline]#duck!#
On a side note, the formatting mark that makes the most sense to me for italicizing text is the forward slash (e.g., /italic text/). However, since the forward slash is a Unix path separator, and most users of AsciiDoc are writing about technical topics, this would cause way too many problems.
Most helpful comment
I've thought about this proposal and I disagree with it for several reasons.
The most significant argument against the proposal is that the use of underline for anything other than a hyperlink in digital publishing is considered deprecated and generally discouraged. Underlined text came into use as a formatting mark for emphasis as a workaround since typewriters had no bold or italic styling capabilities. It was never meant to appear in the final draft. (See http://practicaltypography.com/underlining.html)
All the major style guides (Chicago, New York) explicitly advise against the use of the underline, labeling it as legacy, and the HTML5 specification discourage its use in normal text to avoid confusion with hyperlinks. Text should be emphasized using italics (preferred), bold (used sparingly) or an alternative styling that is still accessible.
I'm also opposed to the use of underscore for underline because this pulls us away from our goal of aligning with Markdown where we can. The two formatting marks in Markdown for italicizing text is the asterisk or the underscore. AsciiDoc already uses the asterisk for bold, so we can't change that. Thus, if we are dropping one of the formatting marks for italicizing text in AsciiDoc, it needs to be the single quote, not the underscore.
If you still want to underline text, perhaps because you're referring to an example of the underline text-decoration in use, you should do it by assigning a role to a span of text:
which converts to the following HTML:
This is already supported in the default AsciiDoc stylesheet.
Note that it's also possible to style text using overline and line-through in a similar fashion:
On a side note, the formatting mark that makes the most sense to me for italicizing text is the forward slash (e.g., /italic text/). However, since the forward slash is a Unix path separator, and most users of AsciiDoc are writing about technical topics, this would cause way too many problems.