mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
8baf537c12 | |||
05823567bc | |||
b7029ab176 | |||
102a947c7a | |||
7bb70186c1 |
@ -110,7 +110,6 @@ class Parsedown
|
||||
|
||||
foreach ($lines as $line)
|
||||
{
|
||||
#
|
||||
# fenced elements
|
||||
|
||||
switch ($element['type'])
|
||||
@ -168,7 +167,6 @@ class Parsedown
|
||||
continue;
|
||||
}
|
||||
|
||||
#
|
||||
# composite elements
|
||||
|
||||
switch ($element['type'])
|
||||
@ -238,7 +236,6 @@ class Parsedown
|
||||
break;
|
||||
}
|
||||
|
||||
#
|
||||
# indentation sensitive types
|
||||
|
||||
$deindented_line = $line;
|
||||
@ -336,7 +333,6 @@ class Parsedown
|
||||
break;
|
||||
}
|
||||
|
||||
#
|
||||
# indentation insensitive types
|
||||
|
||||
switch ($deindented_line[0])
|
||||
@ -572,7 +568,11 @@ class Parsedown
|
||||
|
||||
strpos($text, "\x1A\\") !== FALSE and $text = strtr($text, $this->escape_sequence_map);
|
||||
|
||||
$markup .= '<pre><code>'.$text.'</code></pre>'."\n";
|
||||
$markup .= isset($element['language'])
|
||||
? '<pre><code class="language-'.$element['language'].'">'.$text.'</code></pre>'
|
||||
: '<pre><code>'.$text.'</code></pre>';
|
||||
|
||||
$markup .= "\n";
|
||||
|
||||
break;
|
||||
|
||||
|
17
README.md
17
README.md
@ -1,8 +1,20 @@
|
||||
## Parsedown
|
||||
|
||||
Fast and consistent [Markdown][1] parser for PHP.
|
||||
Better [Markdown][1] parser for PHP.
|
||||
|
||||
[Home](http://parsedown.org) · [Demo](http://parsedown.org/explorer/) · [Tests](http://parsedown.org/tests/)
|
||||
***
|
||||
|
||||
[home](http://parsedown.org/) · [demo](http://parsedown.org/demo) · [tests](http://parsedown.org/tests/)
|
||||
|
||||
***
|
||||
|
||||
Features:
|
||||
|
||||
* [fast](http://parsedown.org/speed)
|
||||
* [consistent](http://parsedown.org/consistency)
|
||||
* [ GitHub Flavored ][2]
|
||||
* tested in PHP 5.2, 5.3, 5.4 and 5.5
|
||||
* friendly to international input
|
||||
|
||||
### Installation
|
||||
|
||||
@ -19,3 +31,4 @@ echo $result; # prints: <p>Hello <strong>Parsedown</strong>!</p>
|
||||
```
|
||||
|
||||
[1]: http://daringfireball.net/projects/markdown/
|
||||
[2]: https://help.github.com/articles/github-flavored-markdown
|
||||
|
@ -1,5 +1,4 @@
|
||||
<p><strong><em>em strong</em></strong></p>
|
||||
<p><strong><em>one</em> at the start</strong></p>
|
||||
<p><strong>one at the <em>end</em></strong></p>
|
||||
<p><strong>one <em>in the</em> middle</strong></p>
|
||||
<p><strong>one with <em>asterisks</em></strong></p>
|
||||
<p><strong><em>em strong</em> strong</strong></p>
|
||||
<p><strong>strong <em>em strong</em></strong></p>
|
||||
<p><strong>strong <em>em strong</em> strong</strong></p>
|
||||
<p><strong>strong <em>em strong</em></strong></p>
|
@ -1,9 +1,7 @@
|
||||
___em strong___
|
||||
___em strong_ strong__
|
||||
|
||||
___one_ at the start__
|
||||
__strong _em strong___
|
||||
|
||||
__one at the _end___
|
||||
__strong _em strong_ strong__
|
||||
|
||||
__one _in the_ middle__
|
||||
|
||||
**one with *asterisks***
|
||||
**strong *em strong***
|
Reference in New Issue
Block a user