06.07 Basic Markdown and text formatting - practicalseries/GitHub-Wiki-Design-and-Implementation GitHub Wiki

PAL Logo showing Wiki Documentation heading

6.7SpacerEmphasis with underlining

There is no direct support for underlining text in Markdown (nothing with asterisks or underscores), but it can be achieved with the use of the HTML insert tag: <ins>…</ins> or the underline tag: <u>…</u>.

Markdown and GitHub output
${\large \color{#0050C0}\text{M\ A\ R\ K\ D\ O\ W\ N}}$ πŸ”½

The next word is <ins>underlined</ins>

or

The next word is <u>underlined</u>

${\large \color{#00C050}\text{H\ T\ M\ L}}$ πŸ”½

<p>The next word is <ins>underlined</ins></p>

or

<p>The next word is <u>underlined</u></p>

${\large \color{#B00000}\text{G\ I\ T\ H\ U\ B}\space\ \space\text{O\ U\ T\ P\ U\ T}}$ πŸ”½

The next word is underlined

Table 6.28 β€” Underlined text

Unlike bold and italics, underlining cannot carry over between lines. Each line must be underlined individually:

Markdown and GitHub output
${\large \color{#0050C0}\text{M\ A\ R\ K\ D\ O\ W\ N}}$ πŸ”½

This is not in underlined <ins>the rest of the line is</ins>

<ins>This line is also underlined</ins>

${\large \color{#00C050}\text{H\ T\ M\ L}}$ πŸ”½

<p>This is not in underlined <ins>the rest of the line is</ins></p>
<p><ins>This line is also underlined</ins></p>

${\large \color{#B00000}\text{G\ I\ T\ H\ U\ B}\space\ \space\text{O\ U\ T\ P\ U\ T}}$ πŸ”½

This is not in underlined the rest of the line is

This line is also underlined

Table 6.29 β€” Underlined text across lines

Note

Although both <u> and <ins> work in Wiki .md files, the <u> does not work in repository Markdown files (for example the README.md file). Consequently, for compatibility, I recommend using the <ins> in place of <u>; see section 5.6.

⬆️ Top



6.7.1SpacerMarkdown rules for underlining

❢ The first rule is don’t underline things. Ever! Underlined text can be confused as a link, plus it just looks bad
❷ Use a <ins> before the text that is to be underlined and a </ins> at the end
❸ code><u> does not work in main repository Markdown files
❹ Underlining does not span blank lines
List 6.7 β€” Markdown rules for underlining

⬆️ Top



6.7.2SpacerUnderlining text examples

Markdown, HTML equivalence and GitHub output
${\large \color{#0050C0}\text{M\ A\ R\ K\ D\ O\ W\ N}}$ πŸ”½

Lorem <ins>ipsum</ins> sit


Lorem <u>ipsum</u> sit

${\large \color{#00C050}\text{H\ T\ M\ L}}$ πŸ”½

<p>Lorem <ins>ipsum</ins> sit</p>


<p>Lorem <u>ipsum</u> sit</p>

${\large \color{#B00000}\text{G\ I\ T\ H\ U\ B}\space\ \space\text{O\ U\ T\ P\ U\ T}}$ πŸ”½

Lorem ipsum sit

Lorem ipsum sit

Table 6.30 β€” Underlined text examples

⬆️ Top



6.8SpacerEmphasis with strikethrough

Strikethrough applies a line through the middle of text. It can be applied to any text by surrounding it with two tildes ~~ i.e.

Markdown and GitHub output
${\large \color{#0050C0}\text{M\ A\ R\ K\ D\ O\ W\ N}}$ πŸ”½

The next word has been ~~struck~~ through

${\large \color{#00C050}\text{H\ T\ M\ L}}$ πŸ”½

<p>The next word has been <del>struck</del> through</p>
<p>The next word has been <s>struck</s> through</p>

${\large \color{#B00000}\text{G\ I\ T\ H\ U\ B}\space\ \space\text{O\ U\ T\ P\ U\ T}}$ πŸ”½

The next word has been struck through

Table 6.31 β€” Strikethrough text

Both of the HTML tags <del>…</del> and <s>…</s>πŸ’ 1 cause the text to be struct through.

⬆️ Top



6.8.1SpacerMarkdown rules for strikethrough

❢ Surround the text that is to be in struck through with two tildes ~~ before and after
❷ Strikethrough text cannot span lines
List 6.8 β€” Markdown rules for strikethrough

⬆️ Top



6.8.2SpacerStrikethrough text examples

Markdown, HTML equivalence and GitHub output
${\large \color{#0050C0}\text{M\ A\ R\ K\ D\ O\ W\ N}}$ πŸ”½

Lorem ~~ipsum~~ sit

${\large \color{#00C050}\text{H\ T\ M\ L}}$ πŸ”½

<p>Lorem <del>ipsum</del> sit</p>

or

<p>Lorem <s>ipsum</s> sit</p>

${\large \color{#B00000}\text{G\ I\ T\ H\ U\ B}\space\ \space\text{O\ U\ T\ P\ U\ T}}$ πŸ”½

Lorem ipsum sit

Table 6.33 β€” Strikethrough text examples

⬆️ Top



6.9SpacerSuperscript and subscript

There is no direct support for superscript or subscript text in Markdown (nothing with asterisks or underscores), but it can be achieved with the use of the HTML tags: <sup>…</sup> for superscript and: <sub>…</sub> for subscript

Markdown, HTML equivalence and GitHub output
${\large \color{#0050C0}\text{M\ A\ R\ K\ D\ O\ W\ N}}$ πŸ”½

The next word is <sup>superscript</sup>

The next word is <sub>subscript</sub>

${\large \color{#00C050}\text{H\ T\ M\ L}}$ πŸ”½

<p>The next word is <sup>superscript</sup></p>

<p>The next word is <sub>subscript</sub></p>

${\large \color{#B00000}\text{G\ I\ T\ H\ U\ B}\space\ \space\text{O\ U\ T\ P\ U\ T}}$ πŸ”½

The next word is superscript

The next word is subscript

Table 6.34 β€” Superscript and subscript text

⬆️ Top



6.9.1SpacerMarkdown rules for superscript and subscript

❢ Use a <sup> before the text that is to be superscript and a </sup> at the end
❷ Use a <sub> before the text that is to be subscript and a </sub> at the end
❸ Superscript and subscript do not span blank lines
List 6.9 β€” Markdown rules for superscript and subscript

⬆️ Top



6.9.2SpacerSuperscript and subscript text examples

Markdown, HTML equivalence and GitHub output
${\large \color{#0050C0}\text{M\ A\ R\ K\ D\ O\ W\ N}}$ πŸ”½

Lorem <sup>ipsum</sup> dolor sit


Lorem <sub>ipsum</sub> dolor sit

${\large \color{#00C050}\text{H\ T\ M\ L}}$ πŸ”½

<p>Lorem <sup>ipsum</sup> dolor sit</p>


<p>Lorem <sub>ipsum</sub> dolor sit</p>

${\large \color{#B00000}\text{G\ I\ T\ H\ U\ B}\space\ \space\text{O\ U\ T\ P\ U\ T}}$ πŸ”½

Lorem ipsum dolor sit

Lorem ipsum dolor sit

Table 6.35 β€” Superscript and subscript text examples

Footnotes:     


Note

πŸ’ 1 Both <s> and <del> tags will strikethrough text. The difference between the tags is purely semantic, <del> tells the browser that the content has been removed after the site was first published (it has textual significance), <s> simply means that the text is has been struck through and has no specific meaning in terms of textual content.↩


⚠️ **GitHub.com Fallback** ⚠️