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
``` 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>
<code>&lt;?php
<pre><code>&lt;?php
$message = 'Hello World!';
echo $message;</code>
</pre>
echo $message;</code></pre>
<hr />
<pre>
<code>&gt; not a quote
<pre><code>&gt; not a quote
- not a list item
[not a reference]: http://foo.com</code>
</pre>
[not a reference]: http://foo.com</code></pre>

View File

@ -1,16 +1,12 @@
<ul>
<li>
li
<li>li
<ul>
<li>
li
<li>li
<ul>
<li>li</li>
<li>li</li>
</ul>
</li>
</ul></li>
<li>li</li>
</ul>
</li>
</ul></li>
<li>li</li>
</ul>

View File

@ -1,6 +1,4 @@
<p>escaped *emphasis*.</p>
<p><code>escaped \*emphasis\* in a code span</code></p>
<pre>
<code>escaped \*emphasis\* in a code block</code>
</pre>
<pre><code>escaped \*emphasis\* in a code block</code></pre>
<p>\ ` * _ { } [ ] ( ) > # + - . !</p>

View File

@ -1,12 +1,6 @@
<pre>
<code>&lt;?php
<pre><code>&lt;?php
$message = 'fenced code block';
echo $message;</code>
</pre>
<pre>
<code>tilde</code>
</pre>
<pre>
<code class="language-php">echo 'language identifier';</code>
</pre>
echo $message;</code></pre>
<pre><code>tilde</code></pre>
<pre><code class="language-php">echo 'language identifier';</code></pre>

View File

@ -1,8 +1,6 @@
<pre>
<code>&lt;?php
<pre><code>&lt;?php
$message = 'Hello World!';
echo $message;
echo "following a blank line";</code>
</pre>
echo "following a blank line";</code></pre>

View File

@ -3,5 +3,6 @@
<p>[one][404] with no definition</p>
<p><a href="http://example.com">multiline
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>

View File

@ -11,8 +11,11 @@
[multiline
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
[one]
[1] with the a label on the next line
[`link`][website]

View File

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