mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
f08d017bcb | |||
e61a6114b0 | |||
9ed72ccd09 |
@ -32,8 +32,7 @@ class Parsedown
|
|||||||
$this->DefinitionData = array();
|
$this->DefinitionData = array();
|
||||||
|
|
||||||
# standardize line breaks
|
# standardize line breaks
|
||||||
$text = str_replace("\r\n", "\n", $text);
|
$text = str_replace(array("\r\n", "\r"), "\n", $text);
|
||||||
$text = str_replace("\r", "\n", $text);
|
|
||||||
|
|
||||||
# remove surrounding line breaks
|
# remove surrounding line breaks
|
||||||
$text = trim($text, "\n");
|
$text = trim($text, "\n");
|
||||||
@ -892,6 +891,11 @@ class Parsedown
|
|||||||
|
|
||||||
protected function blockTableContinue($Line, array $Block)
|
protected function blockTableContinue($Line, array $Block)
|
||||||
{
|
{
|
||||||
|
if (isset($Block['interrupted']))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ($Line['text'][0] === '|' or strpos($Line['text'], '|'))
|
if ($Line['text'][0] === '|' or strpos($Line['text'], '|'))
|
||||||
{
|
{
|
||||||
$Elements = array();
|
$Elements = array();
|
||||||
@ -1298,7 +1302,7 @@ class Parsedown
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/^\([ ]*([^ ]+?)(?:[ ]+(".+?"|\'.+?\'))?[ ]*\)/', $remainder, $matches))
|
if (preg_match('/^[(]((?:[^ (]|[(][^ )]+[)])+)(?:[ ]+("[^"]+"|\'[^\']+\'))?[)]/', $remainder, $matches))
|
||||||
{
|
{
|
||||||
$Element['attributes']['href'] = $matches[1];
|
$Element['attributes']['href'] = $matches[1];
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<p><a href="http://example.com">link</a> and <a href="/tests/">another link</a></p>
|
<p><a href="http://example.com">link</a> and <a href="/url-with-(parentheses)">another link</a></p>
|
||||||
<p><a href="http://example.com"><code>link</code></a></p>
|
<p><a href="http://example.com"><code>link</code></a></p>
|
||||||
<p><a href="http://example.com"><img src="http://parsedown.org/md.png" alt="MD Logo" /></a></p>
|
<p><a href="http://example.com"><img src="http://parsedown.org/md.png" alt="MD Logo" /></a></p>
|
||||||
<p><a href="http://example.com"><img src="http://parsedown.org/md.png" alt="MD Logo" /> and text</a></p>
|
<p><a href="http://example.com"><img src="http://parsedown.org/md.png" alt="MD Logo" /> and text</a></p>
|
@ -1,4 +1,4 @@
|
|||||||
[link](http://example.com) and [another link](/tests/)
|
[link](http://example.com) and [another link](/url-with-(parentheses))
|
||||||
|
|
||||||
[`link`](http://example.com)
|
[`link`](http://example.com)
|
||||||
|
|
||||||
|
@ -1 +1,4 @@
|
|||||||
<p><a href="http://example.com" title="Title">single quotes</a> and <a href="http://example.com" title="Title">double quotes</a></p>
|
<p><a href="http://example.com" title="Title">single quotes</a></p>
|
||||||
|
<p><a href="http://example.com" title="Title">double quotes</a></p>
|
||||||
|
<p><a href="http://example.com" title="2 Words">space</a></p>
|
||||||
|
<p><a href="http://example.com/url-(parentheses)" title="Title">parentheses</a></p>
|
@ -1 +1,7 @@
|
|||||||
[single quotes](http://example.com 'Title') and [double quotes](http://example.com "Title")
|
[single quotes](http://example.com 'Title')
|
||||||
|
|
||||||
|
[double quotes](http://example.com "Title")
|
||||||
|
|
||||||
|
[space](http://example.com "2 Words")
|
||||||
|
|
||||||
|
[parentheses](http://example.com/url-(parentheses) "Title")
|
Reference in New Issue
Block a user