161

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

6
  • 3
    a pure guess: cos underline is synonymous with links
    – jk.
    Aug 9, 2013 at 9:47
  • 7
    This question appears to be off-topic because it is about the choices made by one individual creating a textual markup language, not about programming. Aug 9, 2013 at 9:52
  • 6
    @MartijnPieters still, markup is related to programming
    – Matsemann
    Aug 9, 2013 at 11:07
  • 28
    i dont agree with the off topic thing however, are you seriously saying that markdown is just as unrelated to programming than accounting software? Do you use markdown? if you did you would probably not say that, and where is this. I would say the closer of off topic-ness is primarily opinion based in the first place. It didn't hurt anything and the question was answered. The ops need to get off their high horses and the users need to stop being afraid of the ops just because they fear for loss of their precious rep points. (Which is why I have so little, hehe) Jun 13, 2015 at 17:34
  • 9
    Thanks for bringing this up. I don't feel that this is off-topic. I do agree that it is not directly related to Software Development but I see markdown files in almost all open source projects for README, LICENSE etc. Moreover, I was just curious about why programmers has left out underline which was well answered by Edd.
    – ganessh
    Jun 13, 2015 at 18:00

1 Answer 1

142

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.

11
  • 7
    Bet 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.
    – ruffin
    Jan 13, 2016 at 18:40
  • 2
    Well 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".
    – galaxis
    Jul 20, 2018 at 14:10
  • 5
    Emphasis 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
  • 3
    Grr. 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.
    – Spencer D
    Feb 27, 2019 at 22:44
  • 2
    Comments 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

Not the answer you're looking for? Browse other questions tagged or ask your own question.