Why there is no markdown for underline?

  • 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

    a pure guess: cos underline is synonymous with links

    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.

    @MartijnPieters still, markup is related to programming

    @Matsemann, This question is about an application domain and no more on topic than a question about accounting would be, even formulated in the context of an accounting program.

    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)

    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`.

    +1 I bite my thumb, sir.

  • Edd

    Edd Correct answer

    7 years ago

    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.

    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.*

    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".

    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"

    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.

    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 **t**hat. If you dislike the way either emphasis is presented you should complain about the presenting tool/browser.

License under CC-BY-SA with attribution


Content dated before 6/26/2020 9:53 AM