diff --git a/Parsedown.php b/Parsedown.php
index 0258075..b622d15 100755
--- a/Parsedown.php
+++ b/Parsedown.php
@@ -972,6 +972,7 @@ class Parsedown
'*' => array('Emphasis'),
'/' => array('Url'),
'<' => array('UrlTag', 'EmailTag', 'Tag', 'LessThan'),
+ '>' => array('GreaterThan'),
'[' => array('Link'),
'_' => array('Emphasis'),
'`' => array('InlineCode'),
@@ -981,7 +982,7 @@ class Parsedown
# ~
- protected $spanMarkerList = '*_!&[`~\\';
+ protected $spanMarkerList = '*_!&[<>/`~\\';
#
# ~
@@ -1132,6 +1133,14 @@ class Parsedown
);
}
+ protected function identifyGreaterThan()
+ {
+ return array(
+ 'markup' => '>',
+ 'extent' => 1,
+ );
+ }
+
protected function identifyUrlTag($Excerpt)
{
if (strpos($Excerpt['text'], '>') !== false and preg_match('/^<(https?:[\/]{2}[^\s]+?)>/i', $Excerpt['text'], $matches))
@@ -1175,7 +1184,7 @@ class Parsedown
return;
}
- if (strpos($Excerpt['text'], '>') !== false and preg_match('/^<\/?\w.*?>/', $Excerpt['text'], $matches))
+ if (strpos($Excerpt['text'], '>') !== false and preg_match('/^<\/?\w.*?>/s', $Excerpt['text'], $matches))
{
return array(
'markup' => $matches[0],
@@ -1188,10 +1197,11 @@ class Parsedown
{
$marker = $Excerpt['text'][0];
- if (preg_match('/^('.$marker.'+)[ ]*(.+?)[ ]*(? strlen($matches[0]),
@@ -1267,8 +1277,8 @@ class Parsedown
$Element = array(
'name' => 'img',
'attributes' => array(
- 'alt' => $Link['text'],
'src' => $url,
+ 'alt' => $Link['text'],
),
);
}
@@ -1332,9 +1342,10 @@ class Parsedown
protected function readPlainText($text)
{
- $breakMarker = $this->breaksEnabled ? "\n" : " \n";
+ $breakMarker = $this->breaksEnabled ? "\n" : array(" \n", "\\\n");
$text = str_replace($breakMarker, "
\n", $text);
+ $text = str_replace(" \n", "\n", $text);
return $text;
}
diff --git a/test/data/image_reference.html b/test/data/image_reference.html
index b3249cb..6e45cba 100644
--- a/test/data/image_reference.html
+++ b/test/data/image_reference.html
@@ -1 +1 @@
-
link and another link
- - \ No newline at end of file + + \ No newline at end of file diff --git a/test/data/special_characters.html b/test/data/special_characters.html index 8199abc..3b652c3 100644 --- a/test/data/special_characters.html +++ b/test/data/special_characters.html @@ -1,6 +1,6 @@AT&T has an ampersand in their name
this & that
-4 < 5 and 6 > 5
+4 < 5 and 6 > 5
\ No newline at end of file