mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Compare commits
122 Commits
v1.7.2
...
1.8.0-beta
Author | SHA1 | Date | |
---|---|---|---|
600db7e4de | |||
1be2a01de8 | |||
f50ba3d803 | |||
387ef63888 | |||
68be90348c | |||
48b9f71bdc | |||
0039cd00f8 | |||
c6b717cc35 | |||
8f3f61883d | |||
4c9ea94d0c | |||
32e69de014 | |||
201299ddc2 | |||
557db7c179 | |||
0c0ed38290 | |||
798bda682e | |||
9b7b7348b4 | |||
96581dbe16 | |||
06b810cd4a | |||
38ea813b0e | |||
24e48e91c8 | |||
e33f1a48c8 | |||
1c8f6bc253 | |||
ed3e967fb6 | |||
3b3d13489b | |||
498c88c4eb | |||
772c919b05 | |||
cf6d23de55 | |||
d0279cdd3b | |||
8a90586218 | |||
390fa0da1b | |||
9026b1abdb | |||
68736f8800 | |||
535110c57e | |||
ce073c9baa | |||
e4d6c8f911 | |||
cbe2e74d52 | |||
aa90dd481a | |||
20e592359f | |||
9f1f5de387 | |||
40b9da7837 | |||
a9c21447ce | |||
a3e02c1d0e | |||
40e797031e | |||
448b72a149 | |||
92e426e0e8 | |||
07216480db | |||
caea783006 | |||
d849d64611 | |||
00e51ee424 | |||
0550c3eaf9 | |||
790aed42ab | |||
1c52cb6b5e | |||
ae13290221 | |||
e16162e288 | |||
244ea0aaa6 | |||
2f291e0b2f | |||
d2a73f9179 | |||
f594d4c18b | |||
21cdd8a0b3 | |||
a52d386250 | |||
dd9f4036ee | |||
e7fbbf537b | |||
cac63f6fcb | |||
f71bec00f4 | |||
913e04782f | |||
1fa6b038af | |||
e59fbd736d | |||
8c14c5c239 | |||
0205a4cbe6 | |||
011465bca6 | |||
adcba80502 | |||
65d7bc5013 | |||
1a47e74be1 | |||
56cc41803a | |||
d86d839677 | |||
d5ded2b935 | |||
098f24d189 | |||
eb55e426b9 | |||
ced6187ca5 | |||
972648ff64 | |||
77dc0a090a | |||
88dc949890 | |||
624a08b7eb | |||
3fc54bc966 | |||
ef7ed7b66c | |||
e4c5be026d | |||
e6444bb57e | |||
a3265e7c6f | |||
aac00ac742 | |||
6830c3339f | |||
19f1bb9353 | |||
721b885dd3 | |||
f70d96479a | |||
72d30d33bc | |||
c05ef0c12a | |||
47e4163a68 | |||
c05bff047a | |||
6a4afac0d0 | |||
129f807e32 | |||
be963a6531 | |||
1d0af35f10 | |||
d7956e3ade | |||
67e454e300 | |||
a3836b1853 | |||
a9e1163c85 | |||
7b1529fff0 | |||
1d61f90bf9 | |||
4b3b7df710 | |||
30ff5c6e75 | |||
bdf537e9d5 | |||
81025cd468 | |||
e691034861 | |||
eb853da92a | |||
6973302ca8 | |||
0a43799da4 | |||
2db3199510 | |||
8965c7864f | |||
d26b33c20f | |||
d9679141fa | |||
0bd61a73ed | |||
06c4344a71 | |||
c4d4a6800d |
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1,5 +1,6 @@
|
||||
# Ignore all tests for archive
|
||||
/test export-ignore
|
||||
/.gitattributes export-ignore
|
||||
/.gitignore export-ignore
|
||||
/.travis.yml export-ignore
|
||||
/phpunit.xml.dist export-ignore
|
||||
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
composer.lock
|
||||
vendor/
|
@ -13,11 +13,13 @@ matrix:
|
||||
- php: 7.0
|
||||
- php: 7.1
|
||||
- php: 7.2
|
||||
- php: 7.3
|
||||
- php: nightly
|
||||
- php: hhvm
|
||||
- php: hhvm-nightly
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- php: nightly
|
||||
- php: hhvm-nightly
|
||||
|
||||
install:
|
||||
- composer install --prefer-dist --no-interaction --no-progress
|
||||
|
778
Parsedown.php
Normal file → Executable file
778
Parsedown.php
Normal file → Executable file
File diff suppressed because it is too large
Load Diff
15
README.md
15
README.md
@ -19,12 +19,21 @@ Better Markdown Parser in PHP
|
||||
* Super Fast
|
||||
* Extensible
|
||||
* [GitHub flavored](https://help.github.com/articles/github-flavored-markdown)
|
||||
* Tested in 5.3 to 7.1 and in HHVM
|
||||
* Tested in 5.3 to 7.2 and in HHVM
|
||||
* [Markdown Extra extension](https://github.com/erusev/parsedown-extra)
|
||||
|
||||
### Installation
|
||||
#### Composer
|
||||
Install the [composer package] by running the following command:
|
||||
|
||||
Include `Parsedown.php` or install [the composer package](https://packagist.org/packages/erusev/parsedown).
|
||||
composer require erusev/parsedown
|
||||
|
||||
#### Manual
|
||||
1. Download the "Source code" from the [latest release]
|
||||
2. Include `Parsedown.php`
|
||||
|
||||
[composer package]: https://packagist.org/packages/erusev/parsedown "The Parsedown package on packagist.org"
|
||||
[latest release]: https://github.com/erusev/parsedown/releases/latest "The latest release of Parsedown"
|
||||
|
||||
### Example
|
||||
|
||||
@ -32,6 +41,8 @@ Include `Parsedown.php` or install [the composer package](https://packagist.org/
|
||||
$Parsedown = new Parsedown();
|
||||
|
||||
echo $Parsedown->text('Hello _Parsedown_!'); # prints: <p>Hello <em>Parsedown</em>!</p>
|
||||
// you can also parse inline markdown only
|
||||
echo $Parsedown->line('Hello _Parsedown_!'); # prints: Hello <em>Parsedown</em>!
|
||||
```
|
||||
|
||||
More examples in [the wiki](https://github.com/erusev/parsedown/wiki/) and in [this video tutorial](http://youtu.be/wYZBY8DEikI).
|
||||
|
44
test/ParsedownTest.php
Normal file → Executable file
44
test/ParsedownTest.php
Normal file → Executable file
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
require 'SampleExtensions.php';
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
@ -12,7 +13,8 @@ class ParsedownTest extends TestCase
|
||||
parent::__construct($name, $data, $dataName);
|
||||
}
|
||||
|
||||
private $dirs, $Parsedown;
|
||||
private $dirs;
|
||||
protected $Parsedown;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
@ -49,12 +51,48 @@ class ParsedownTest extends TestCase
|
||||
$expectedMarkup = str_replace("\r", "\n", $expectedMarkup);
|
||||
|
||||
$this->Parsedown->setSafeMode(substr($test, 0, 3) === 'xss');
|
||||
$this->Parsedown->setStrictMode(substr($test, 0, 6) === 'strict');
|
||||
$this->Parsedown->setLiteralBreaks(substr($test, 0, 14) === 'literal_breaks');
|
||||
|
||||
$actualMarkup = $this->Parsedown->text($markdown);
|
||||
|
||||
$this->assertEquals($expectedMarkup, $actualMarkup);
|
||||
}
|
||||
|
||||
function testRawHtml()
|
||||
{
|
||||
$markdown = "```php\nfoobar\n```";
|
||||
$expectedMarkup = '<pre><code class="language-php"><p>foobar</p></code></pre>';
|
||||
$expectedSafeMarkup = '<pre><code class="language-php"><p>foobar</p></code></pre>';
|
||||
|
||||
$unsafeExtension = new UnsafeExtension;
|
||||
$actualMarkup = $unsafeExtension->text($markdown);
|
||||
|
||||
$this->assertEquals($expectedMarkup, $actualMarkup);
|
||||
|
||||
$unsafeExtension->setSafeMode(true);
|
||||
$actualSafeMarkup = $unsafeExtension->text($markdown);
|
||||
|
||||
$this->assertEquals($expectedSafeMarkup, $actualSafeMarkup);
|
||||
}
|
||||
|
||||
function testTrustDelegatedRawHtml()
|
||||
{
|
||||
$markdown = "```php\nfoobar\n```";
|
||||
$expectedMarkup = '<pre><code class="language-php"><p>foobar</p></code></pre>';
|
||||
$expectedSafeMarkup = $expectedMarkup;
|
||||
|
||||
$unsafeExtension = new TrustDelegatedExtension;
|
||||
$actualMarkup = $unsafeExtension->text($markdown);
|
||||
|
||||
$this->assertEquals($expectedMarkup, $actualMarkup);
|
||||
|
||||
$unsafeExtension->setSafeMode(true);
|
||||
$actualSafeMarkup = $unsafeExtension->text($markdown);
|
||||
|
||||
$this->assertEquals($expectedSafeMarkup, $actualSafeMarkup);
|
||||
}
|
||||
|
||||
function data()
|
||||
{
|
||||
$data = array();
|
||||
@ -123,12 +161,12 @@ MARKDOWN_WITH_MARKUP;
|
||||
<p><div><em>content</em></div></p>
|
||||
<p>sparse:</p>
|
||||
<p><div>
|
||||
<div class="inner">
|
||||
<div class="inner">
|
||||
<em>content</em>
|
||||
</div>
|
||||
</div></p>
|
||||
<p>paragraph</p>
|
||||
<p><style type="text/css">
|
||||
<p><style type="text/css">
|
||||
p {
|
||||
color: red;
|
||||
}
|
||||
|
40
test/SampleExtensions.php
Normal file
40
test/SampleExtensions.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
class UnsafeExtension extends Parsedown
|
||||
{
|
||||
protected function blockFencedCodeComplete($Block)
|
||||
{
|
||||
$text = $Block['element']['element']['text'];
|
||||
unset($Block['element']['element']['text']);
|
||||
|
||||
// WARNING: There is almost always a better way of doing things!
|
||||
//
|
||||
// This example is one of them, unsafe behaviour is NOT needed here.
|
||||
// Only use this if you trust the input and have no idea what
|
||||
// the output HTML will look like (e.g. using an external parser).
|
||||
$Block['element']['element']['rawHtml'] = "<p>$text</p>";
|
||||
|
||||
return $Block;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class TrustDelegatedExtension extends Parsedown
|
||||
{
|
||||
protected function blockFencedCodeComplete($Block)
|
||||
{
|
||||
$text = $Block['element']['element']['text'];
|
||||
unset($Block['element']['element']['text']);
|
||||
|
||||
// WARNING: There is almost always a better way of doing things!
|
||||
//
|
||||
// This behaviour is NOT needed in the demonstrated case.
|
||||
// Only use this if you are sure that the result being added into
|
||||
// rawHtml is safe.
|
||||
// (e.g. using an external parser with escaping capabilities).
|
||||
$Block['element']['element']['rawHtml'] = "<p>$text</p>";
|
||||
$Block['element']['element']['allowRawHtmlInSafeMode'] = true;
|
||||
|
||||
return $Block;
|
||||
}
|
||||
}
|
@ -6,4 +6,8 @@
|
||||
<h6>h6</h6>
|
||||
<p>####### not a heading</p>
|
||||
<h1>closed h1</h1>
|
||||
<p>#</p>
|
||||
<h1></h1>
|
||||
<h2></h2>
|
||||
<h1># of levels</h1>
|
||||
<h1># of levels #</h1>
|
||||
<h1>heading</h1>
|
@ -15,3 +15,11 @@
|
||||
# closed h1 #
|
||||
|
||||
#
|
||||
|
||||
##
|
||||
|
||||
# # of levels
|
||||
|
||||
# # of levels # #
|
||||
|
||||
#heading
|
@ -1,12 +1,40 @@
|
||||
<ul>
|
||||
<li>li
|
||||
<ul>
|
||||
<li>li
|
||||
<ul>
|
||||
<li>li<ul>
|
||||
<li>li<ul>
|
||||
<li>li</li>
|
||||
<li>li</li>
|
||||
</ul></li>
|
||||
<li>li</li>
|
||||
</ul></li>
|
||||
<li>li</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>li</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>li</li>
|
||||
</ul>
|
||||
<hr />
|
||||
<ul>
|
||||
<li>level 1<ul>
|
||||
<li>level 2<ul>
|
||||
<li>level 3<ul>
|
||||
<li>level 4<ul>
|
||||
<li>level 5</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<hr />
|
||||
<ul>
|
||||
<li>a</li>
|
||||
<li>b</li>
|
||||
<li>c</li>
|
||||
<li>d</li>
|
||||
<li>e</li>
|
||||
<li>f</li>
|
||||
<li>g</li>
|
||||
<li>h</li>
|
||||
<li>i</li>
|
||||
</ul>
|
@ -4,3 +4,23 @@
|
||||
- li
|
||||
- li
|
||||
- li
|
||||
|
||||
---
|
||||
|
||||
- level 1
|
||||
- level 2
|
||||
- level 3
|
||||
- level 4
|
||||
- level 5
|
||||
|
||||
---
|
||||
|
||||
- a
|
||||
- b
|
||||
- c
|
||||
- d
|
||||
- e
|
||||
- f
|
||||
- g
|
||||
- h
|
||||
- i
|
@ -1 +1,2 @@
|
||||
<p>my email is <a href="mailto:me@example.com">me@example.com</a></p>
|
||||
<p>html tags shouldn't start an email autolink <strong>first.last@example.com</strong></p>
|
@ -1 +1,3 @@
|
||||
my email is <me@example.com>
|
||||
|
||||
html tags shouldn't start an email autolink <strong>first.last@example.com</strong>
|
@ -9,3 +9,6 @@ echo $message;</code></pre>
|
||||
echo "Hello World";
|
||||
?>
|
||||
<a href="http://auraphp.com" >Aura Project</a></code></pre>
|
||||
<pre><code>the following isn't quite enough to close
|
||||
```
|
||||
still a fenced code block</code></pre>
|
@ -23,3 +23,9 @@ echo "Hello World";
|
||||
?>
|
||||
<a href="http://auraphp.com" >Aura Project</a>
|
||||
```
|
||||
|
||||
````
|
||||
the following isn't quite enough to close
|
||||
```
|
||||
still a fenced code block
|
||||
````
|
@ -3,3 +3,9 @@
|
||||
<!--
|
||||
multiline -->
|
||||
<p>paragraph</p>
|
||||
<!-- sss -->abc
|
||||
<ul>
|
||||
<li>abcd</li>
|
||||
<li>bbbb</li>
|
||||
<li>cccc</li>
|
||||
</ul>
|
@ -6,3 +6,9 @@ paragraph
|
||||
multiline -->
|
||||
|
||||
paragraph
|
||||
|
||||
<!-- sss -->abc
|
||||
|
||||
* abcd
|
||||
* bbbb
|
||||
* cccc
|
@ -1,6 +1,8 @@
|
||||
<blockquote>
|
||||
<p>quote
|
||||
the rest of it</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>another paragraph
|
||||
the rest of it</p>
|
||||
</blockquote>
|
6
test/data/literal_breaks.html
Normal file
6
test/data/literal_breaks.html
Normal file
@ -0,0 +1,6 @@
|
||||
<p>first line
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
sixth line</p>
|
6
test/data/literal_breaks.md
Normal file
6
test/data/literal_breaks.md
Normal file
@ -0,0 +1,6 @@
|
||||
first line
|
||||
|
||||
|
||||
|
||||
|
||||
sixth line
|
3
test/data/markup_consecutive_one.html
Normal file
3
test/data/markup_consecutive_one.html
Normal file
@ -0,0 +1,3 @@
|
||||
<div>Markup</div>
|
||||
_No markdown_ without blank line for **strict** compliance with CommonMark.
|
||||
<p><strong>Markdown</strong></p>
|
4
test/data/markup_consecutive_one.md
Normal file
4
test/data/markup_consecutive_one.md
Normal file
@ -0,0 +1,4 @@
|
||||
<div>Markup</div>
|
||||
_No markdown_ without blank line for **strict** compliance with CommonMark.
|
||||
|
||||
**Markdown**
|
4
test/data/markup_consecutive_one_line.html
Normal file
4
test/data/markup_consecutive_one_line.html
Normal file
@ -0,0 +1,4 @@
|
||||
<div>One markup on
|
||||
two lines</div>
|
||||
_No markdown_
|
||||
<p><strong>Markdown</strong></p>
|
5
test/data/markup_consecutive_one_line.md
Normal file
5
test/data/markup_consecutive_one_line.md
Normal file
@ -0,0 +1,5 @@
|
||||
<div>One markup on
|
||||
two lines</div>
|
||||
_No markdown_
|
||||
|
||||
**Markdown**
|
3
test/data/markup_consecutive_one_stripped.html
Normal file
3
test/data/markup_consecutive_one_stripped.html
Normal file
@ -0,0 +1,3 @@
|
||||
<div><p>Stripped markup</p></div>
|
||||
_No markdown_
|
||||
<p><strong>Markdown</strong></p>
|
4
test/data/markup_consecutive_one_stripped.md
Normal file
4
test/data/markup_consecutive_one_stripped.md
Normal file
@ -0,0 +1,4 @@
|
||||
<div><p>Stripped markup</p></div>
|
||||
_No markdown_
|
||||
|
||||
**Markdown**
|
3
test/data/markup_consecutive_two.html
Normal file
3
test/data/markup_consecutive_two.html
Normal file
@ -0,0 +1,3 @@
|
||||
<div>First markup</div><p>and second markup on the same line.</p>
|
||||
_No markdown_
|
||||
<p><strong>Markdown</strong></p>
|
4
test/data/markup_consecutive_two.md
Normal file
4
test/data/markup_consecutive_two.md
Normal file
@ -0,0 +1,4 @@
|
||||
<div>First markup</div><p>and second markup on the same line.</p>
|
||||
_No markdown_
|
||||
|
||||
**Markdown**
|
4
test/data/markup_consecutive_two_lines.html
Normal file
4
test/data/markup_consecutive_two_lines.html
Normal file
@ -0,0 +1,4 @@
|
||||
<div>First markup</div><p>and partial markup
|
||||
on two lines.</p>
|
||||
_No markdown_
|
||||
<p><strong>Markdown</strong></p>
|
5
test/data/markup_consecutive_two_lines.md
Normal file
5
test/data/markup_consecutive_two_lines.md
Normal file
@ -0,0 +1,5 @@
|
||||
<div>First markup</div><p>and partial markup
|
||||
on two lines.</p>
|
||||
_No markdown_
|
||||
|
||||
**Markdown**
|
4
test/data/markup_consecutive_two_stripped.html
Normal file
4
test/data/markup_consecutive_two_stripped.html
Normal file
@ -0,0 +1,4 @@
|
||||
<div><p>Stripped markup
|
||||
on two lines</p></div>
|
||||
_No markdown_
|
||||
<p><strong>Markdown</strong></p>
|
5
test/data/markup_consecutive_two_stripped.md
Normal file
5
test/data/markup_consecutive_two_stripped.md
Normal file
@ -0,0 +1,5 @@
|
||||
<div><p>Stripped markup
|
||||
on two lines</p></div>
|
||||
_No markdown_
|
||||
|
||||
**Markdown**
|
@ -11,3 +11,6 @@
|
||||
<ol start="123">
|
||||
<li>one</li>
|
||||
</ol>
|
||||
<p>foo 1. the following should not start a list
|
||||
100.<br />
|
||||
200. </p>
|
@ -9,3 +9,7 @@ repeating numbers:
|
||||
large numbers:
|
||||
|
||||
123. one
|
||||
|
||||
foo 1. the following should not start a list
|
||||
100.
|
||||
200.
|
@ -1,12 +1,18 @@
|
||||
<hr>
|
||||
|
||||
paragraph
|
||||
<hr/>
|
||||
|
||||
paragraph
|
||||
<hr />
|
||||
|
||||
paragraph
|
||||
<hr class="foo" id="bar" />
|
||||
|
||||
paragraph
|
||||
<hr class="foo" id="bar"/>
|
||||
|
||||
paragraph
|
||||
<hr class="foo" id="bar" >
|
||||
|
||||
paragraph
|
12
test/data/setext_header_spaces.html
Normal file
12
test/data/setext_header_spaces.html
Normal file
@ -0,0 +1,12 @@
|
||||
<h1>trailing space</h1>
|
||||
<h2>trailing space</h2>
|
||||
<h1>leading and trailing space</h1>
|
||||
<h2>leading and trailing space</h2>
|
||||
<h1>1 leading space</h1>
|
||||
<h2>1 leading space</h2>
|
||||
<h1>3 leading spaces</h1>
|
||||
<h2>3 leading spaces</h2>
|
||||
<p>too many leading spaces
|
||||
==</p>
|
||||
<p>too many leading spaces
|
||||
--</p>
|
29
test/data/setext_header_spaces.md
Normal file
29
test/data/setext_header_spaces.md
Normal file
@ -0,0 +1,29 @@
|
||||
trailing space
|
||||
==
|
||||
|
||||
trailing space
|
||||
--
|
||||
|
||||
leading and trailing space
|
||||
==
|
||||
|
||||
leading and trailing space
|
||||
--
|
||||
|
||||
1 leading space
|
||||
==
|
||||
|
||||
1 leading space
|
||||
--
|
||||
|
||||
3 leading spaces
|
||||
==
|
||||
|
||||
3 leading spaces
|
||||
--
|
||||
|
||||
too many leading spaces
|
||||
==
|
||||
|
||||
too many leading spaces
|
||||
--
|
@ -9,3 +9,18 @@
|
||||
<blockquote>
|
||||
<p>quote</p>
|
||||
</blockquote>
|
||||
<hr />
|
||||
<blockquote>
|
||||
<blockquote>
|
||||
<blockquote>
|
||||
<p>Info 1 text</p>
|
||||
</blockquote>
|
||||
</blockquote>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<blockquote>
|
||||
<blockquote>
|
||||
<p>Info 2 text</p>
|
||||
</blockquote>
|
||||
</blockquote>
|
||||
</blockquote>
|
@ -5,3 +5,9 @@ indented:
|
||||
|
||||
no space after `>`:
|
||||
>quote
|
||||
|
||||
---
|
||||
|
||||
>>> Info 1 text
|
||||
|
||||
>>> Info 2 text
|
@ -35,3 +35,35 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr />
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: left;">header 1</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align: left;">cell 1.1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: left;">cell 2.1</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr />
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>header 1</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>cell 1.1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>cell 2.1</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
@ -9,3 +9,17 @@ header 1 | header 2
|
||||
:------- | --------
|
||||
cell 1.1 | cell 1.2
|
||||
cell 2.1 | cell 2.2
|
||||
|
||||
---
|
||||
|
||||
header 1
|
||||
:-------
|
||||
cell 1.1
|
||||
cell 2.1
|
||||
|
||||
---
|
||||
|
||||
header 1
|
||||
-------|
|
||||
cell 1.1
|
||||
cell 2.1
|
@ -1,8 +1,6 @@
|
||||
<div>
|
||||
line 1
|
||||
|
||||
line 2
|
||||
line 3
|
||||
|
||||
line 4
|
||||
<p>line 2
|
||||
line 3</p>
|
||||
<p>line 4</p>
|
||||
</div>
|
13
test/data/strict_atx_heading.html
Normal file
13
test/data/strict_atx_heading.html
Normal file
@ -0,0 +1,13 @@
|
||||
<h1>h1</h1>
|
||||
<h2>h2</h2>
|
||||
<h3>h3</h3>
|
||||
<h4>h4</h4>
|
||||
<h5>h5</h5>
|
||||
<h6>h6</h6>
|
||||
<p>####### not a heading</p>
|
||||
<p>#not a heading</p>
|
||||
<h1>closed h1</h1>
|
||||
<h1></h1>
|
||||
<h2></h2>
|
||||
<h1># of levels</h1>
|
||||
<h1># of levels #</h1>
|
25
test/data/strict_atx_heading.md
Normal file
25
test/data/strict_atx_heading.md
Normal file
@ -0,0 +1,25 @@
|
||||
# h1
|
||||
|
||||
## h2
|
||||
|
||||
### h3
|
||||
|
||||
#### h4
|
||||
|
||||
##### h5
|
||||
|
||||
###### h6
|
||||
|
||||
####### not a heading
|
||||
|
||||
#not a heading
|
||||
|
||||
# closed h1 #
|
||||
|
||||
#
|
||||
|
||||
##
|
||||
|
||||
# # of levels
|
||||
|
||||
# # of levels # #
|
@ -2,9 +2,21 @@
|
||||
<li>li</li>
|
||||
<li>li</li>
|
||||
</ul>
|
||||
<p>mixed markers:</p>
|
||||
<p>mixed unordered markers:</p>
|
||||
<ul>
|
||||
<li>li</li>
|
||||
<li>li</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>li</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>li</li>
|
||||
</ul>
|
||||
<p>mixed ordered markers:</p>
|
||||
<ol>
|
||||
<li>starting at 1, list one</li>
|
||||
<li>number 2, list one</li>
|
||||
</ol>
|
||||
<ol start="3">
|
||||
<li>starting at 3, list two</li>
|
||||
</ol>
|
@ -1,8 +1,14 @@
|
||||
- li
|
||||
- li
|
||||
|
||||
mixed markers:
|
||||
mixed unordered markers:
|
||||
|
||||
* li
|
||||
+ li
|
||||
- li
|
||||
|
||||
mixed ordered markers:
|
||||
|
||||
1. starting at 1, list one
|
||||
2. number 2, list one
|
||||
3) starting at 3, list two
|
Reference in New Issue
Block a user