For H1 and H2, you can also use underline-style syntax:
markdown
1
2
3
4
5
Alt-H1
======
Alt-H2
------
Alt-H1
Alt-H2
Emphasis
markdown
1
2
3
4
5
6
7
Emphasis, aka italics, with *asterisks* or _underscores_.
Strong emphasis, aka bold, with **asterisks** or __underscores__.
Combined emphasis with **asterisks and _underscores_**.
Strikethrough uses two tildes. ~~Scratch this.~~
Emphasis, aka italics, with asterisks or underscores.
Strong emphasis, aka bold, with asterisks or underscores.
Combined emphasis with asterisks and underscores.
Strikethrough uses two tildes. Scratch this.
Lists
Unordered Lists
markdown
1
2
3
4
5
6
7
8
9
10
11
* List Item 1
* List Item 2
* List Item 3
- Or use hyphens
- Another item
- One more
+ Or plus signs
+ Work too
+ Great!
List Item 1
List Item 2
List Item 3
Or use hyphens
Another item
One more
Or plus signs
Work too
Great!
Ordered Lists
markdown
1
2
3
1. First ordered list item
2. Another item
3. And another one
First ordered list item
Another item
And another one
Nested Lists
markdown
1
2
3
4
5
6
7
8
9
10
1. First item
1. Nested item 1
2. Nested item 2
- Deep nested item
- Another deep item
2. Second item
* Nested unordered
* Another nested
* Even deeper
* Keep going
First item
Nested item 1
Nested item 2
Deep nested item
Another deep item
Second item
Nested unordered
Another nested
Even deeper
Keep going
Lists with Multiple Paragraphs
markdown
1
2
3
4
5
6
7
* First item
This is a continuation of the first item with proper indentation.
* Second item
Another paragraph under the second item.
First item
This is a continuation of the first item with proper indentation.
Second item
Another paragraph under the second item.
Task Lists
markdown
1
2
3
4
- [x] Completed task
- [ ] Incomplete task
- [x]@mentions, #refs, [links](), **formatting**, and ~~tags~~ supported
- [ ] this is an incomplete item
Completed task
Incomplete task
@mentions, #refs, links, formatting, and tags supported
this is an incomplete item
Definition Lists
Goldmark supports definition lists using standard markdown syntax:
markdown
1
2
3
4
5
6
7
Term 1
: Definition 1a
: Definition 1b
Term 2
: Definition 2a
: Definition 2b
Term 1
Definition 1a
Definition 1b
Term 2
Definition 2a
Definition 2b
Links
Inline Links
markdown
1
2
3
[I'm an inline-style link](https://www.google.com)
[I'm an inline-style link with title](https://www.google.com "Google's Homepage")
[I'm a reference-style link][arbitrary case-insensitive reference text]
[You can use numbers for reference-style link definitions][1]
Or leave it empty and use the [link text itself].
[arbitrary case-insensitive reference text]: https://www.mozilla.org
[1]: http://slashdot.org
[link text itself]: http://www.reddit.com
/**
* @author John Smith <john.smith@example.com>
*/packagel2f.gameserver.model;publicabstractclassL2CharextendsL2Object{publicstaticfinalShortERROR=0x0001;publicvoidmoveTo(intx,inty,intz){_ai=null;log("Should not be called");if(1>5){// wtf!?return;}}}
C++
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include<iostream>intmain(intargc,char*argv[]){/* An annoying "Hello World" example */for(autoi=0;i<0xFFFF;i++)cout<<"Hello, World!"<<endl;charc='\n';unordered_map<string,vector<string>>m;m["key"]="\\\\";// this is an error
return-2e3+12l;}
<!DOCTYPE html><title>Title</title><style>body{width:500px;}</style><scripttype="application/javascript">function$init(){returntrue;}</script><body><pcheckedclass="title"id="title">Title</p><!-- here goes the rest of the page --></body>
> Blockquotes are very handy in email to emulate reply text.
> This line is part of the same quote.
Blockquotes are very handy in email to emulate reply text.
This line is part of the same quote.
Nested Blockquotes
markdown
1
2
3
4
5
> This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level.
This is the first level of quoting.
This is nested blockquote.
Back to the first level.
Blockquotes with Other Elements
markdown
1
2
3
4
5
6
7
8
> ## This is a header.
>
> 1. This is the first list item.
> 2. This is the second list item.
>
> Here's some example code:
>
> return shell_exec("echo $input | $markdown_script");
> [!NOTE]
> Useful information that users should know, even when skimming content.
> [!TIP]
> Helpful advice for doing things better or more easily.
> [!IMPORTANT]
> Key information users need to know to achieve their goal.
> [!WARNING]
> Urgent info that needs immediate user attention to avoid problems.
> [!CAUTION]
> Advises about risks or negative outcomes of certain actions.
Note
Useful information that users should know, even when skimming content.
Tip
Helpful advice for doing things better or more easily.
Important
Key information users need to know to achieve their goal.
Warning
Urgent info that needs immediate user attention to avoid problems.
Caution
Advises about risks or negative outcomes of certain actions.
Horizontal Rules
markdown
1
2
3
4
5
6
7
Three or more hyphens, asterisks, or underscores:
---
***
___
Three or more hyphens, asterisks, or underscores:
Footnotes
markdown
1
2
3
4
5
6
7
8
9
10
11
Here's a sentence with a footnote[^1].
Another sentence with a footnote[^2].
You can also use inline footnotes^[This is an inline footnote].
[^1]: This is the first footnote.
[^2]: This is the second footnote with **formatting** and multiple paragraphs.
Add indented paragraphs to include them in the footnote.
You can also use inline footnotes^[This is an inline footnote].
Paragraphs and Line Breaks
Regular Paragraphs
Lorem ipsum dolor sit amet, test link consectetur adipiscing elit. Strong text pellentesque ligula commodo viverra vehicula. Italic text at ullamcorper enim. Morbi a euismod nibh. Underline text non elit nisl. Deleted text tristique, sem id condimentum tempus, metus lectus venenatis mauris, sit amet semper lorem felis a eros.
Interdum et malesuada fames ac ante ipsum primis in faucibus. Sed erat diam, blandit eget felis aliquam, rhoncus varius urna. Donec tellus sapien, sodales eget ante vitae, feugiat ullamcorper urna.
Line Breaks
To create a line break, end a line with two or more spaces:
markdown
1
2
This is the first line.
This is the second line.
This is the first line. This is the second line.
Escaping Characters
You can escape Markdown formatting characters with backslashes:
markdown
1
2
3
\*This text is not italic\*
\[This is not a link\]
*This text is not italic*
[This is not a link]
Mathematical Formulas
Goldmark supports LaTeX-style mathematical formulas with appropriate extensions: