mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
make parser class more extensible
This commit is contained in:
parent
4e670129c8
commit
5be4491943
2295
Parsedown.php
2295
Parsedown.php
File diff suppressed because it is too large
Load Diff
@ -23,7 +23,7 @@ Include `Parsedown.php` or install [the composer package](https://packagist.org/
|
|||||||
### Example
|
### Example
|
||||||
|
|
||||||
``` php
|
``` php
|
||||||
$parsedown = new Parsedown();
|
$Parsedown = new Parsedown();
|
||||||
|
|
||||||
echo $parsedown->parse('Hello _Parsedown_!'); # prints: <p>Hello <em>Parsedown</em>!</p>
|
echo $Parsedown->text('Hello _Parsedown_!'); # prints: <p>Hello <em>Parsedown</em>!</p>
|
||||||
```
|
```
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
<pre>
|
<pre><code><?php
|
||||||
<code><?php
|
|
||||||
|
|
||||||
$message = 'Hello World!';
|
$message = 'Hello World!';
|
||||||
echo $message;</code>
|
echo $message;</code></pre>
|
||||||
</pre>
|
|
||||||
<hr />
|
<hr />
|
||||||
<pre>
|
<pre><code>> not a quote
|
||||||
<code>> not a quote
|
|
||||||
- not a list item
|
- not a list item
|
||||||
[not a reference]: http://foo.com</code>
|
[not a reference]: http://foo.com</code></pre>
|
||||||
</pre>
|
|
@ -1,16 +1,12 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>li
|
||||||
li
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>li
|
||||||
li
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>li</li>
|
<li>li</li>
|
||||||
<li>li</li>
|
<li>li</li>
|
||||||
</ul>
|
</ul></li>
|
||||||
</li>
|
|
||||||
<li>li</li>
|
<li>li</li>
|
||||||
</ul>
|
</ul></li>
|
||||||
</li>
|
|
||||||
<li>li</li>
|
<li>li</li>
|
||||||
</ul>
|
</ul>
|
@ -1,6 +1,4 @@
|
|||||||
<p>escaped *emphasis*.</p>
|
<p>escaped *emphasis*.</p>
|
||||||
<p><code>escaped \*emphasis\* in a code span</code></p>
|
<p><code>escaped \*emphasis\* in a code span</code></p>
|
||||||
<pre>
|
<pre><code>escaped \*emphasis\* in a code block</code></pre>
|
||||||
<code>escaped \*emphasis\* in a code block</code>
|
|
||||||
</pre>
|
|
||||||
<p>\ ` * _ { } [ ] ( ) > # + - . !</p>
|
<p>\ ` * _ { } [ ] ( ) > # + - . !</p>
|
@ -1,12 +1,6 @@
|
|||||||
<pre>
|
<pre><code><?php
|
||||||
<code><?php
|
|
||||||
|
|
||||||
$message = 'fenced code block';
|
$message = 'fenced code block';
|
||||||
echo $message;</code>
|
echo $message;</code></pre>
|
||||||
</pre>
|
<pre><code>tilde</code></pre>
|
||||||
<pre>
|
<pre><code class="language-php">echo 'language identifier';</code></pre>
|
||||||
<code>tilde</code>
|
|
||||||
</pre>
|
|
||||||
<pre>
|
|
||||||
<code class="language-php">echo 'language identifier';</code>
|
|
||||||
</pre>
|
|
@ -1,8 +1,6 @@
|
|||||||
<pre>
|
<pre><code><?php
|
||||||
<code><?php
|
|
||||||
|
|
||||||
$message = 'Hello World!';
|
$message = 'Hello World!';
|
||||||
echo $message;
|
echo $message;
|
||||||
|
|
||||||
echo "following a blank line";</code>
|
echo "following a blank line";</code></pre>
|
||||||
</pre>
|
|
@ -3,5 +3,6 @@
|
|||||||
<p>[one][404] with no definition</p>
|
<p>[one][404] with no definition</p>
|
||||||
<p><a href="http://example.com">multiline
|
<p><a href="http://example.com">multiline
|
||||||
one</a> defined on 2 lines</p>
|
one</a> defined on 2 lines</p>
|
||||||
<p><a href="http://example.com">one</a> with an upper case label</p>
|
<p><a href="http://example.com">one</a> with a mixed case label and an upper case definition</p>
|
||||||
|
<p><a href="http://example.com">one</a> with the a label on the next line</p>
|
||||||
<p><a href="http://example.com"><code>link</code></a></p>
|
<p><a href="http://example.com"><code>link</code></a></p>
|
@ -11,8 +11,11 @@
|
|||||||
[multiline
|
[multiline
|
||||||
one][website] defined on 2 lines
|
one][website] defined on 2 lines
|
||||||
|
|
||||||
[one][label] with an upper case label
|
[one][Label] with a mixed case label and an upper case definition
|
||||||
|
|
||||||
[LABEL]: http://example.com
|
[LABEL]: http://example.com
|
||||||
|
|
||||||
|
[one]
|
||||||
|
[1] with the a label on the next line
|
||||||
|
|
||||||
[`link`][website]
|
[`link`][website]
|
@ -1,3 +1 @@
|
|||||||
<pre>
|
<pre><code>code</code></pre>
|
||||||
<code>code</code>
|
|
||||||
</pre>
|
|
Loading…
x
Reference in New Issue
Block a user