Markdown & font weight tests
Better Markdown Parser in PHP - Tests
It's time to copy&paste.
[TOC]
- Markdown tests
- h1
- closed h1
- Automatic Link
- Block-level Html
- Code Block
- Code Span
- Compound Blockquote
- Compound Emphasis
- Compound List
- Deeply Nested List
- Em Strong
- Emphasis
- Escaping
- Fenced Code Block
- Horizontal Rule
- Html Comment
- Html Entity
- Image Reference
- Image Title
- Implicit Reference
- Inline Link
- Inline Link Title
- Inline Title
- Lazy Blockquote
- Lazy List
- Line Break
- Multiline List Paragraph
- Nested Block-level Html
- Ordered List
- Paragraph List
- Reference Title
- Self-closing Html
- Separated Nested List
- Setext Header
- Simple Blockquote
- Simple Table
- Span-level Html
- Sparse Dense List
- Sparse Html
- Sparse List
- Special Characters
- Strikethrough
- Strong Em
- Tab-indented Code Block
- Table Inline Markdown
- Text Reference
- Unordered List
- Untidy Table
- Url Autolinking
- Whitespace
- Font weight tests
Markdown tests
Aesthetic Table
| header 1 | header 2 |
| -------- | -------- |
| cell 1.1 | cell 1.2 |
| cell 2.1 | cell 2.2 |
header 1 | header 2 |
---|---|
cell 1.1 | cell 1.2 |
cell 2.1 | cell 2.2 |
Aligned Table
| header 1 | header 2 | header 2 |
| :------- | :------: | -------: |
| cell 1.1 | cell 1.2 | cell 1.3 |
| cell 2.1 | cell 2.2 | cell 2.3 |
header 1 | header 2 | header 2 |
---|---|---|
cell 1.1 | cell 1.2 | cell 1.3 |
cell 2.1 | cell 2.2 | cell 2.3 |
Atx Heading
# h1
## h2
### h3
#### h4
##### h5
###### h6
####### not a heading
# closed h1 #
#
h1
h2
h3
h4
h5
h6
closed h1
Automatic Link
<https://example.com>
Block-level Html
<div>_content_</div>
paragraph
<div>
<div class="inner">
_content_
</div>
</div>
<style type="text/css">
p {color: #789;}
</style>
<div>
<a href="/">home</a></div>
paragraph
Code Block
<?php
$message = 'Hello World!';
echo $message;
---
> not a quote
- not a list item
[not a reference]: https://foo.com
<?php
$message = 'Hello World!';
echo $message;
> not a quote
- not a list item
[not a reference]: https://foo.com
Code Span
a `code span`
`this is also a codespan` trailing text
`and look at this one!`
single backtick in a code span: `` ` ``
backtick-delimited string in a code span: `` `foo` ``
`sth `` sth`
a code span
this is also a codespan
trailing text
and look at this one!
single backtick in a code span: `
backtick-delimited string in a code span: `foo`
sth `` sth
Compound Blockquote
> header
> ------
>
> paragraph
>
> - li
>
> ---
>
> paragraph
header
paragraph
- li
paragraph
Compound Emphasis
_`code`_ __`code`__
*`code`**`code`**`code`*
code
code
code
code
code
Compound List
- paragraph
paragraph
- paragraph
> quote
-
paragraph
paragraph
-
paragraph
quote
Deeply Nested List
- li
- li
- li
- li
- li
- li
- li
- li
- li
- li
- li
- li
- li
Em Strong
___em strong___
___em strong_ strong__
__strong _em strong___
__strong _em strong_ strong__
***em strong***
***em strong* strong**
**strong *em strong***
**strong *em strong* strong**
em strong
em strong strong
strong em strong
strong em strong strong
em strong
em strong strong
strong em strong
strong em strong strong
my email is <[email protected]>
my email is [email protected]
Emphasis
_underscore_, *asterisk*, _one two_, *three four*, _a_, *b*
**strong** and *em* and **strong** and *em*
_line
line
line_
this_is_not_an_emphasis
an empty emphasis __ ** is not an emphasis
*mixed **double and* single asterisk** spans
underscore, asterisk, one two, three four, a, b
strong and em and strong and em
line
line
line
this_is_not_an_emphasis
an empty emphasis __ ** is not an emphasis
*mixed *double and single asterisk** spans
Escaping
escaped \*emphasis\*.
`escaped \*emphasis\* in a code span`
escaped \*emphasis\* in a code block
\\ \` \* \_ \{ \} \[ \] \( \) \> \# \+ \- \. \!
_one\_two_ __one\_two__
*one\*two* **one\*two**
escaped *emphasis*.
escaped \*emphasis\* in a code span
escaped \*emphasis\* in a code block
\ ` * _ { } [ ] ( ) > # + - . !
one_two one_two
one*two one*two
Fenced Code Block
```
<?php
$message = 'fenced code block';
echo $message;
```
~~~
tilde
~~~
```php
echo 'language identifier';
```
<?php
$message = 'fenced code block';
echo $message;
tilde
echo 'language identifier';
Horizontal Rule
---
- - -
- - -
***
___
Html Comment
<!-- single line -->
paragraph
<!--
multiline -->
paragraph
paragraph
paragraph
Html Entity
& © {
& © {
Image Reference
![Markdown Logo][https://parsedown.org/md.png]
[image]: https://parsedown.org/md.png
![missing reference]
![Markdown Logo][https://parsedown.org/md.png]
![missing reference]
Image Title


Implicit Reference
an [implicit] reference link
[implicit]: https://example.com
an [implicit][] reference link with an empty link definition
an [implicit][] reference link followed by [another][]
[another]: https://cnn.com
an [explicit][example] reference link with a title
[example]: https://example.com "Example"
an implicit reference link
an implicit reference link with an empty link definition
an implicit reference link followed by another
an explicit reference link with a title
Inline Link
[link](https://example.com)
[link](/url-(parentheses)) with parentheses in URL
([link](/index.php)) in parentheses
[`link`](https://example.com)
[](https://example.com)
[ and text](https://example.com)
[ and text](https://example.com)
link with parentheses in URL
(link) in parentheses
Inline Link Title
[single quotes](https://example.com 'Title')
[double quotes](https://example.com "Title")
[single quotes blank](https://example.com '')
[double quotes blank](https://example.com "")
[space](https://example.com "2 Words")
[parentheses](https://example.com/url-(parentheses) "Title")
Inline Title
[single quotes](https://example.com 'Example') and [double quotes](https://example.com "Example")
single quotes and double quotes
Lazy Blockquote
> quote
the rest of it
> another paragraph
the rest of it
quote
the rest of it
another paragraph
the rest of it
Lazy List
- li
the rest of it
- li
the rest of it
Line Break
line
line
line
line
Multiline List Paragraph
- li
line
line
-
li
line
line
Nested Block-level Html
<div>
_parent_
<div>
_child_
</div>
<pre>
_adopted child_
</pre>
</div>
_outside_
_adopted child_
outside
Ordered List
1. one
2. two
repeating numbers:
1. one
1. two
large numbers:
123. one
- one
- two
repeating numbers:
- one
- two
large numbers:
- one
Paragraph List
paragraph
- li
- li
paragraph
* li
* li
paragraph
- li
- li
paragraph
-
li
-
li
Reference Title
[double quotes] and [single quotes] and [parentheses]
[double quotes]: https://example.com "example title"
[single quotes]: https://example.com 'example title'
[parentheses]: https://example.com (example title)
[invalid title]: https://example.com example title
double quotes and single quotes and parentheses
[invalid title]: https://example.com example title
Self-closing Html
<hr>
paragraph
<hr/>
paragraph
<hr />
paragraph
<hr class="foo" id="bar" />
paragraph
<hr class="foo" id="bar"/>
paragraph
<hr class="foo" id="bar" >
paragraph
paragraph
paragraph
paragraph
paragraph
paragraph
paragraph
Separated Nested List
- li
- li
- li
-
li
- li
- li
Setext Header
h1
==
h2
--
single character
-
not a header
------------
h1
h2
single character
not a header
Simple Blockquote
indented:
> quote
no space after `>`:
>quote
indented:
quote
no space after >
:
quote
Simple Table
header 1 | header 2
-------- | --------
cell 1.1 | cell 1.2
cell 2.1 | cell 2.2
---
header 1 | header 2
:------- | --------
cell 1.1 | cell 1.2
cell 2.1 | cell 2.2
header 1 | header 2 |
---|---|
cell 1.1 | cell 1.2 |
cell 2.1 | cell 2.2 |
header 1 | header 2 |
---|---|
cell 1.1 | cell 1.2 |
cell 2.1 | cell 2.2 |
Span-level Html
an <b>important</b> <a href=''>link</a>
broken<br/>
line
<b>inline tag</b> at the beginning
<span>https://example.com</span>
an important link
broken
line
inline tag at the beginning
Sparse Dense List
- li
- li
- li
-
li
-
li
-
li
Sparse Html
<div>
line 1
line 2
line 3
line 4
</div>
Sparse List
- li
- li
---
- li
- indented li
-
li
-
li
-
li
- indented li
Special Characters
AT&T has an ampersand in their name
this & that
4 < 5 and 6 > 5
<https://example.com/autolink?a=1&b=2>
[inline link](/script?a=1&b=2)
[reference link][1]
[1]: https://example.com/?a=1&b=2
AT&T has an ampersand in their name
this & that
4 < 5 and 6 > 5
https://example.com/autolink?a=1&b=2
Strikethrough
~~strikethrough~~
here's ~~one~~ followed by ~~another one~~
~~ this ~~ is not one neither is ~this~
strikethrough
here's one followed by another one
~~ this ~~ is not one neither is ~this~
Strong Em
*em **strong em***
***strong em** em*
*em **strong em** em*
_em __strong em___
___strong em__ em_
_em __strong em__ em_
em strong em
strong em em
em strong em em
em strong em
strong em em
em strong em em
Tab-indented Code Block
<?php
$message = 'Hello World!';
echo $message;
echo "following a blank line";
<?php
$message = 'Hello World!';
echo $message;
echo "following a blank line";
Table Inline Markdown
| _header_ 1 | header 2 |
| ------------ | ------------ |
| _cell_ 1.1 | ~~cell~~ 1.2 |
| `|` 2.1 | \| 2.2 |
| `\|` 2.1 | [link](/) |
header 1 | header 2 |
---|---|
cell 1.1 | |
| 2.1 |
| 2.2 |
\| 2.1 |
link |
Text Reference
[reference link][1]
[1]: https://example.com
[one][website] with a semantic name
[website]: https://example.com
[one][404] with no definition
[multiline
one][website] defined on 2 lines
[one][Label] with a mixed case label and an upper case definition
[LABEL]: https://example.com
[one]
[1] with the a label on the next line
[`link`][website]
one with a semantic name
[one][404] with no definition
multiline
one defined on 2 lines
one with a mixed case label and an upper case definition
one with the a label on the next line
Unordered List
- li
- li
mixed markers:
* li
+ li
- li
- li
- li
mixed markers:
- li
- li
- li
Untidy Table
| header 1 | header 2 |
| ------------- | ----------- |
| cell 1.1 | cell 1.2 |
| cell 2.1 | cell 2.2 |
header 1 | header 2 |
---|---|
cell 1.1 | cell 1.2 |
cell 2.1 | cell 2.2 |
Url Autolinking
an autolink https://example.com
inside of brackets [https://example.com], inside of braces {https://example.com}, inside of parentheses (https://example.com)
trailing slash https://example.com/ and https://example.com/path/
an autolink https://example.com
inside of brackets [https://example.com], inside of braces {https://example.com}, inside of parentheses (https://example.com)
trailing slash https://example.com/ and https://example.com/path/
Whitespace
code
code
Font weight tests
Fallback sans
我能吞下玻璃而不伤身体。
我能吞下玻璃而不伤身体。
我能吞下玻璃而不伤身体。
我能吞下玻璃而不伤身体。
我能吞下玻璃而不伤身体。
我能吞下玻璃而不伤身体。
我能吞下玻璃而不伤身体。
我能吞下玻璃而不伤身体。
我能吞下玻璃而不伤身体。
Fallback serif
我能吞下玻璃而不伤身体。
我能吞下玻璃而不伤身体。
我能吞下玻璃而不伤身体。
我能吞下玻璃而不伤身体。
我能吞下玻璃而不伤身体。
我能吞下玻璃而不伤身体。
我能吞下玻璃而不伤身体。
我能吞下玻璃而不伤身体。
我能吞下玻璃而不伤身体。
本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。