mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
8baf537c12 | |||
05823567bc | |||
b7029ab176 | |||
102a947c7a |
@ -110,7 +110,6 @@ class Parsedown
|
|||||||
|
|
||||||
foreach ($lines as $line)
|
foreach ($lines as $line)
|
||||||
{
|
{
|
||||||
#
|
|
||||||
# fenced elements
|
# fenced elements
|
||||||
|
|
||||||
switch ($element['type'])
|
switch ($element['type'])
|
||||||
@ -168,7 +167,6 @@ class Parsedown
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# composite elements
|
# composite elements
|
||||||
|
|
||||||
switch ($element['type'])
|
switch ($element['type'])
|
||||||
@ -238,7 +236,6 @@ class Parsedown
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# indentation sensitive types
|
# indentation sensitive types
|
||||||
|
|
||||||
$deindented_line = $line;
|
$deindented_line = $line;
|
||||||
@ -336,7 +333,6 @@ class Parsedown
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# indentation insensitive types
|
# indentation insensitive types
|
||||||
|
|
||||||
switch ($deindented_line[0])
|
switch ($deindented_line[0])
|
||||||
@ -572,7 +568,11 @@ class Parsedown
|
|||||||
|
|
||||||
strpos($text, "\x1A\\") !== FALSE and $text = strtr($text, $this->escape_sequence_map);
|
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;
|
break;
|
||||||
|
|
||||||
|
17
README.md
17
README.md
@ -1,8 +1,20 @@
|
|||||||
## Parsedown
|
## 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
|
### Installation
|
||||||
|
|
||||||
@ -19,3 +31,4 @@ echo $result; # prints: <p>Hello <strong>Parsedown</strong>!</p>
|
|||||||
```
|
```
|
||||||
|
|
||||||
[1]: http://daringfireball.net/projects/markdown/
|
[1]: http://daringfireball.net/projects/markdown/
|
||||||
|
[2]: https://help.github.com/articles/github-flavored-markdown
|
||||||
|
Reference in New Issue
Block a user