I am wondering why there is no markdown syntax for underline? I know that basic html tags can be embedded to achieve this but I am trying to understand why underline
got omitted when bold and italics exists
1 Answer
There are no mention of "bold" or "italics" in the markdown syntax document. What there is, is an emphasis section, which describes how the use of underscore and asterix -marked spans (*
, _
, **
, __
) should produce code wrapped in <em>
and <strong>
tags.
The reason for this, I presume, is that markdown is a markup language, like html, and should not be concerned with how the text is presented (that's the job of the styling/CSS), but to provide semantic meaning to the text. This is particularly useful for people who use non-graphical browsers, where the emphasis can be conveyed in other ways (Think about how a screen-reader could add emphasis when it encounters an <em>
tag, or really add lots of emphasis in the case of the <strong>
tag).
I could well use CSS to style my emphasised text with underlines, rather than italics, but this is not the browser default in most cases.
-
7Bet it's related to html's phrase elements: EM and STRONG are used to indicate emphasis.... The presentation... depends on the user agent. Generally, visual user agents present EM text in italics and STRONG text in bold font. See also HTML5 on the
u
tag: The default rendering of the u element... clashes with the conventional rendering of hyperlinks (underlining). Authors are encouraged to avoid using the u element where it could be confused for a hyperlink.– ruffinJan 13, 2016 at 18:40 -
2Well underlining in markup predates the web/hyperlinks, so how 'bout a lil' respect for us old guys :) Plus, Markup can be used in apps other than web-based (e.g. Rocket Chat desktop), and as a best practice, hyperlinks are best designated in conjunction w/ a color change (or increasingly prevalent, a color change and no underlining). I guess it all depends on what u mean by "presentation" (vs "content); does that include different HTML header sizes (H1, H2, etc.)? I guess as they say, it's not a "rigid guideline".– galaxisJul 20, 2018 at 14:10
-
5Emphasis and strong emphasis aren't the only things writers will do within a text. I want to use it to point the attention to a certain letter. How would you go about writing this in markup? "The correct capitalization is: Shotg̲un" Sep 15, 2018 at 19:17
-
3Grr. I have the same use case as @MarkJeronimus. Someone committed and pushed a capitalized value in a case-sensitive config file, and I would love to be able to just underscore the character that caused the issue. Feb 27, 2019 at 22:44
-
2Comments here are basically missing the point. Markdown is for generic markup of text and it is designed to mark text from a semantic point of view. Whether links are changing color or not isn't inherent to their nature as a link but to the way they are usually presented. A link doesn't have color, its representation in an application might have. Same applies to handling single letters. If you want to "highlight" one character, you actually want to emphasize it, so do right that. If you dislike the way either emphasis is presented you should complain about the presenting tool/browser. Jul 9, 2019 at 15:50
Edd
.