How to make a word underline in Markdown
Solution 1
since markdown is a markup language and In fact you can use HTML/CSS inside it, the easiest way I've found so far is:
text here <span style="text-decoration: underline">underlined text</span> other text
Note: you can still use markdown syntax inside the <span>
tag.
Solution 2
In Jupyter notebook, you can use the following to get underscored text
<u>underscored text </u>
Solution 3
you can just use HTML markups in mark down.
if you want to underline, italic or strong, use follows,
<u> this is underlined </u>
<i> this is italic </i>
<strong> this is strong </strong>
etc..
Solution 4
Using a plugin (markdown-it-ins
)
You can use ++Underlined Text++
to make text underlined in markdown-it.js
. Bear in mind that this is not standard markdown and might not work elsewhere. Here's a demonstration of this working in the markdown-it
website.
This syntactic extension (inserted text) is added by a plugincalled markdown-it-ins. It's enabled by default in the demo page, but you might need to install and enable it manually for your own page.
Using HTML tags inside markdown
If you want this to work for any markdown parser, you should try using the <u>
HTML tag, as most parsers will actually parse HTML inside markdown (this might cause a few unwanted side-effects). markdown-it
supports it, if you enable the related option. Here's an example of this in action.
Related videos on Youtube
RENU SINGH
Updated on September 24, 2021Comments
-
RENU SINGH over 2 years
How to make a word underline in Markdown?
For example: bold =
**bold**
or__bold__
, italic =*Italic*
or_Italic_
.I have tried with 2 and 3 underscores, but it is not working. Also tried by taking the reference of
markdown-it.js
.-
jonrsharpe almost 7 yearsMarkdown doesn't have underline, see e.g. softwareengineering.stackexchange.com/questions/207727/…
-
abhishekkannojia almost 7 yearsTry using
++Underline Me++
markdown-it.js documentation has this. -
RENU SINGH almost 7 yearsFor bold =__bold__ or bold and Italic = Italic or Italic I have tried
-
RENU SINGH almost 7 yearstried ++underline me++ is also not working .
-
abhishekkannojia almost 7 years@RENUSINGH Are you using
markdown-it.js
for parsing ? Or you just took the syntax reference from there. If you are not usingmarkdown-it.js
then I guess it won't work. Or you can try using the standard HTML<u>
tag and see if it works. -
RENU SINGH almost 7 yearsI am not using markdown-it.js. It's just syntax over here ....
-
-
Sergio Tulentsev almost 7 yearsThis doesn't work in stackoverflow's markdown, for example. At the very least, it's non-standard.
-
Angelos Chalaris almost 7 years@SergioTulentsev you're right about that. I am looking for actual documentation to support this. I know it works in
markdown-it.js
, because I have used it and tried it just now, however I cannot find the documentation for it. -
abhishekkannojia almost 7 years@AngelosChalaris It's there on there demo page, but couldn't find any documentation related to this.
-
Angelos Chalaris almost 7 years@abhishekkannojia Thanks for mentioning this, it helped me identify where it comes from (a plugin for inserted text).
-
vancy-pants almost 5 yearsThis worked for me! Is there a reason why someone wouldn't want to use this?
-
Hocine Abdellatif Houari almost 5 yearsprobably some people may want to keep things as clean as possible, using html somehow is like a walk around.
-
lacostenycoder about 4 yearsThis seems to be supported by Github
-
AntLaC almost 4 yearsto help keep it clean you can use a CSS class
.underline-me {text-decoration: underline;}
-
zylstra about 3 years"Is there a reason why someone wouldn't want to use this?" Yeah, because it hasn't worked in any markdown form I've ever come across, Github being the prime example. And maybe because your workaround is so cumbersome? It really blows my mind how anybody does not see that this is needed.
-
Clement over 2 yearsThis does not work in standard markdown.
-
Hermes Morales about 2 yearsI tried it in Google colab with Python and it works
-
Mooks about 2 yearsThis is specific to quarto / rmarkdown and OP doesn't appear to be using those.