14

Possible Duplicate:
Why can we format text with bold and italic but sideline the underline?

How can I underline text in my questions in Stack Overflow??

This is important for me to format object text like in

my:House

in OOP.

This workaround looks a bit stupid at times but maybe it is worth considering. It uses U+0332COMBINING LOW LINE—after each character to render it underlined

I could not combine a semicolon with an underline, so, these are the results.

t̲e̲x̲t̲
m̲y̲:H̲o̲u̲s̲e̲
 :̲

m̲y̲:̲H̲o̲u̲s̲e̲

m̲y̲:H̲o̲u̲s̲e̲

u̲n̲d̲e̲r̲l̲i̲n̲e̲d̲ t̲e̲x̲t̲

u̲n̲d̲e̲r̲l̲i̲n̲e̲d̲

Reference: Why can we format text with bold and italic but not underline?

0

1 Answer 1

11

Markdown doesn't have a defined syntax to underline text so to answer your question, you can't.

3
  • 6
    Not completely true, you can always use ascii underline - however it looks a bit odd when used on characters that have a part under the line (y,g,q,...) There are existing tools that will do this for you e.g. manytools.org/facebook-twitter/strikethrough-text example: n̲i̲c̲e̲ t̲e̲x̲t̲,̲ u̲g̲l̲y̲O̲n̲e̲ y̲,̲g̲,̲q̲,̲.̲.̲.̲
    – jave.web
    Oct 11, 2014 at 11:27
  • @jave.web That's actually awesome and better than nothing.
    – Avatar
    Dec 17, 2017 at 13:15
  • It doesn't have to be pure markdown. There's also that subset of allowed HTML. While deprecated, the admins could allow <u>, much as they have for <b> and <i>. But so far, they haven't, for reasons that remain obscure. Mar 4, 2021 at 23:44

Not the answer you're looking for? Browse other questions tagged .