06.07 Basic Markdown and text formatting - practicalseries/GitHub-Wiki-Design-and-Implementation GitHub Wiki
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 |
---|
|
The next word is <ins>underlined</ins> or The next word is <u>underlined</u>
|
|
<p>The next word is <ins>underlined</ins></p> or <p>The next word is <u>underlined</u></p>
|
|
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 |
---|
|
This is not in underlined <ins>the rest of the line is</ins>
<ins>This line is also underlined</ins>
|
|
<p>This is not in underlined <ins>the rest of the line is</ins></p>
<p><ins>This line is also underlined</ins></p>
|
|
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.
βΆ | 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 |
---|
Markdown, HTML equivalence and GitHub output | |
---|---|
|
|
Lorem <ins>ipsum</ins> sit
|
Lorem <u>ipsum</u> sit
|
|
|
<p>Lorem <ins>ipsum</ins> sit</p>
|
<p>Lorem <u>ipsum</u> sit</p>
|
|
|
Lorem ipsum sit |
Lorem ipsum sit |
Table 6.30 β Underlined text examples |
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 |
---|
|
The next word has been ~~struck~~ through
|
|
<p>The next word has been <del>struck</del> through</p> <p>The next word has been <s>struck</s> through</p>
|
|
The next word has been |
Table 6.31 β Strikethrough text |
Both of the HTML tags <del>β¦</del>
and <s>β¦</s>
π 1 cause the text to be struct through.
βΆ |
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 |
---|
Markdown, HTML equivalence and GitHub output |
---|
|
Lorem ~~ipsum~~ sit
|
|
<p>Lorem <del>ipsum</del> sit</p> or <p>Lorem <s>ipsum</s> sit</p>
|
|
Lorem |
Table 6.33 β Strikethrough text examples |
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 |
---|
|
The next word is <sup>superscript</sup>
The next word is <sub>subscript</sub>
|
|
<p>The next word is <sup>superscript</sup></p>
<p>The next word is <sub>subscript</sub></p>
|
|
The next word is superscript The next word is subscript |
Table 6.34 β Superscript and subscript text |
βΆ |
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 |
---|
Markdown, HTML equivalence and GitHub output | |
---|---|
|
|
Lorem <sup>ipsum</sup> dolor sit
|
Lorem <sub>ipsum</sub> dolor sit
|
|
|
<p>Lorem <sup>ipsum</sup> dolor sit</p>
|
<p>Lorem <sub>ipsum</sub> dolor sit</p>
|
|
|
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.β©