make parser class more extensible

This commit is contained in:
Emanuil Rusev 2014-04-17 10:59:35 +03:00
parent 4e670129c8
commit 5be4491943
10 changed files with 1153 additions and 1206 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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>
``` ```

View File

@ -1,12 +1,8 @@
<pre> <pre><code>&lt;?php
<code>&lt;?php
$message = 'Hello World!'; $message = 'Hello World!';
echo $message;</code> echo $message;</code></pre>
</pre>
<hr /> <hr />
<pre> <pre><code>&gt; not a quote
<code>&gt; 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>

View File

@ -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></li>
</ul>
</li>
<li>li</li> <li>li</li>
</ul> </ul>

View File

@ -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>

View File

@ -1,12 +1,6 @@
<pre> <pre><code>&lt;?php
<code>&lt;?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>

View File

@ -1,8 +1,6 @@
<pre> <pre><code>&lt;?php
<code>&lt;?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>

View File

@ -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>

View File

@ -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]

View File

@ -1,3 +1 @@
<pre> <pre><code>code</code></pre>
<code>code</code>
</pre>