06.04 basic markdown and text formatting - practicalseries/GitHub-Wiki-Design-and-Implementation GitHub Wiki
Any text can be made bold by surrounding it with two asterisks ** (without spaces) i.e.
| Markdown and GitHub output |
|---|
|
|
The next word is in **bold**
|
|
|
<p>The next word is in <strong>bold</strong></p>
|
|
|
|
The next word is in bold |
| Table 6.15 β Bold text |
Bold can carry over between lines:
| Markdown and GitHub output |
|---|
|
|
This is not in bold **the rest is in bold
And so is this.**
|
|
|
<p>This is not in bold <strong>the rest is in bold</strong></p>
<p><strong>And so is this.</strong></p>
|
|
|
|
This is not in bold the rest is in bold And so is this. |
| Table 6.16 β Bold text across lines |
Note
The carry over between lines does not work if the Markdown is inside any form of HTML tag <p>, <table> &c., in such cases, each line must have its own set of asterisks.
A double underscore can be used in exactly the same way
| Markdown and GitHub output |
|---|
|
|
The next word is in __bold__
|
|
|
<p>The next word is in <strong>bold</strong></p>
|
|
|
|
The next word is in bold |
| Table 6.17 β Bold text using underscores |
The use of two underscore characters for bold in the middle of a word is misinterpreted by some Markdown applications. Donβt use underscores, always use asterisks.
| βΆ |
Surround the text that is to be in bold with two asterisks ** before and after |
| β· | Do not use double underscores (always use asterisks) |
| βΈ | Bold text can span lines (but not if inside a HTML tag) |
| βΉ |
Use <strong> in place of asterisks if using bold inside HTML tags |
| List 6.4 β Markdown rules for bold |
|---|
The use of asterisks for bold inside HTML tags is a bit hit and miss; it works if there is at least one blank line separating the Markdown containing the asterisks from the HTML tag itself. I donβt know why.
Generally, it is better to use the <strong> tag for bold text if it is inside any HTML tag.
| Markdown, HTML equivalence and GitHub output | |
|---|---|
|
|
|
Lorem **ipsum** dolor sit
|
Lorem **ipsum dolor sit
Consectetur** elit.
|
|
|
|
<p>Lorem <strong>ipsum</strong> dolor sit </p>
|
<p>Lorem <strong>ipsum dolor sit </strong></p>
<p><strong> Consectetur</strong> elit.</p>
|
|
|
|
|
Lorem ipsum dolor sit |
Lorem ipsum dolor sit Consectetur elit. |
| Table 6.18 β Bold text examples | |
Any text can be made italic by surrounding it with a single asterisk i.e.
| Markdown and GitHub output |
|---|
|
|
The next word is in *italics*
|
|
|
<p>The next word is in <em>italics</em></p>
|
|
|
|
The next word is in italics |
| Table 6.19 β Italic text |
Italics can carry over between lines:
| Markdown and GitHub output |
|---|
|
|
This is not in italics *the rest is in italics
And so is this.*
|
|
|
<p>This is not in italics <em>the rest is in italics</em></p>
<p><em>And so is this.</em></p>
|
|
|
|
This is not in italics the rest is in italics And so is this. |
| Table 6.20 β Italics text across lines |
Note
The carry over between lines does not work if the Markdown is inside any form of HTML tag <p>, <table> &c., in such cases, each line must have its own set of asterisks.
A single underscore can be used in exactly the same way
| Markdown and GitHub output |
|---|
|
|
The next word is in _italics_
|
|
|
<p>The next word is in <em>italics</em></p>
|
|
|
|
The next word is in italics |
| Table 6.21 β Italic text using underscores |
The use of an underscore characters for italics in the middle of a word is misinterpreted by some Markdown applications. Donβt use underscores, always use asterisks.
| βΆ |
Surround the text that is to be in italics with a single asterisk * before and after |
| β· | Do not use double underscores (always use asterisks) |
| βΈ | Italic text can span lines (but not if inside a HTML tag) |
| βΉ |
Use <em> in place of asterisks if using italics inside HTML tags |
| List 6.5 β Markdown rules for italics |
|---|
The use of asterisks for italics inside HTML tags is a bit hit and miss; it works if there is at least one blank line separating the Markdown containing the asterisks from the HTML tag itself. I donβt know why.
Generally, it is better to use the <em> tag for italic text if it is inside any HTML tag.
| Markdown, HTML equivalence and GitHub output | |
|---|---|
|
|
|
Lorem *ipsum* dolor sit
|
Lorem *ipsum dolor sit
Consectetur* elit.
|
|
|
|
<p>Lorem <em>ipsum</em> dolor sit </p>
|
<p>Lorem <em>ipsum dolor sit </em></p>
<p><em> Consectetur</em> elit.</p>
|
|
|
|
|
Lorem ipsum dolor sit |
Lorem ipsum dolor sit Consectetur elit. |
| Table 6.22 β Italic text examples | |
Any text can be made both bold and italic by surrounding it with three asterisks i.e.
| Markdown and GitHub output |
|---|
|
|
This is ***both bold and italics***
|
|
|
<p>This is <strong><em>both bold and italics</em></strong></p>
|
|
|
|
This is both bold and italics |
| Table 6.23 β Both bold and italic text |
Bold and italics can carry over between lines:
| Markdown and GitHub output |
|---|
|
|
This is normal ***the rest is in bold and italics
And so is this.***
|
|
|
<p>TThis is normal <strong><em>the rest is in bold and italics</em></strong></p>
<p><strong><em>And so is this.</em></strong></p>
|
|
|
|
This is normal the rest is in bold and italics And so is this. |
| Table 6.24 β Both bold and italic text across lines |
Note
The carry over between lines does not work if the Markdown is inside any form of HTML tag <p>, <table> &c., in such cases, each line must have its own set of asterisks.
Itβs possible to split where bold and italic occur:
| Markdown and GitHub output |
|---|
|
|
This is **bold *bold and italic* just bold**
This is *italic **bold and italic** just italic*
|
|
|
<p>This is <strong>bold<em> bold and italic</em> just bold</strong></p>
<p>This is <em>italic<strong> bold and italic</strong> just italic</em></p>
|
|
|
|
This is bold bold and italic just bold This is italic bold and italic just italic |
| Table 6.25 β Splitting bold and italics |
A triple underscore can be used in exactly the same way
| Markdown and GitHub output |
|---|
|
|
This is ___both bold and italics___
|
|
|
<p>This is <strong><em>both bold and italics</em></strong></p>
|
|
|
|
This is both bold and italics |
| Table 6.26 β Both bold and italics text using underscores |
The use of an underscore characters for italics in the middle of a word is misinterpreted by some Markdown applications. Donβt use underscores, always use asterisks.
| βΆ |
Surround the text that is to be in both bold and italics with three asterisks *** before and after |
| β· | Do not use double underscores (always use asterisks) |
| βΈ | Both bold and italics text can span lines (but not if inside a HTML tag) |
| βΉ |
Use <strong> and <em> in place of asterisks if using bold and italics inside HTML tags |
| List 6.6 β Markdown rules for both bold and italics |
|---|
The use of asterisks for italics inside HTML tags is a bit hit and miss; it works if there is at least one blank line separating the Markdown containing the asterisks from the HTML tag itself. I donβt know why.
Generally, it is better to use the <strong> and <em> tags for bold and italics text if it is inside any HTML tag.
| Markdown, HTML equivalence and GitHub output | |
|---|---|
|
|
|
Lorem ***ipsum*** dolor sit
|
Lorem ***ipsum
Consectetur*** elit
|
|
|
|
<p>Lorem <strong><em>ipsum</em></strong> dolor sit</p>
|
<p>Lorem <strong><em>ipsum </em></strong></p>
<p><strong><em>Consectetur</em></strong> elit</p>
|
|
|
|
|
Lorem ipsum dolor sit |
Lorem ipsum Consectetur elit |
| Table 6.27 β Both bold and italic 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.β©