diff --git a/GithubMarkdown.php b/GithubMarkdown.php index 23c9d1a..bc9e73d 100644 --- a/GithubMarkdown.php +++ b/GithubMarkdown.php @@ -71,7 +71,8 @@ protected function consumeParagraph($lines, $current) $this->identifyFencedCode($line, $lines, $i) || $this->identifyUl($line, $lines, $i) || $this->identifyOl($line, $lines, $i) || - $this->identifyHr($line, $lines, $i) + $this->identifyHr($line, $lines, $i) || + $this->identifyHtml($line, $lines, $i) ) || $this->identifyHeadline($line, $lines, $i)) { diff --git a/Markdown.php b/Markdown.php index 32c9b0f..a369ea0 100644 --- a/Markdown.php +++ b/Markdown.php @@ -92,9 +92,17 @@ protected function consumeParagraph($lines, $current) break; } - if ($line === '' || ltrim($line) === '' || $this->identifyHeadline($line, $lines, $i)) { + if ( + $line === '' || + ltrim($line) === '' || + !ctype_alpha($line[0]) && ( + $this->identifyQuote($line, $lines, $i) || + $this->identifyHr($line, $lines, $i) || + $this->identifyHtml($line, $lines, $i) + ) + || $this->identifyHeadline($line, $lines, $i)) { break; - } elseif ($line[0] === "\t" || $line[0] === " " && strncmp($line, ' ', 4) === 0) { + } elseif ($this->identifyCode($line, $lines, $i)) { // possible beginning of a code block // but check for continued inline HTML // e.g. changelog 2 +

paragraph

+

quote

+
+

paragraph

+
+

paragraph

+
html block
diff --git a/tests/github-data/dense-block-markers.md b/tests/github-data/dense-block-markers.md index ea365b8..db09cf8 100644 --- a/tests/github-data/dense-block-markers.md +++ b/tests/github-data/dense-block-markers.md @@ -53,4 +53,13 @@ headline2 ---- ## changelog 2 -* 17-Feb-2013 re-design \ No newline at end of file +* 17-Feb-2013 re-design + +paragraph +> quote + +paragraph +- - - + +paragraph +
html block
diff --git a/tests/markdown-data/dense-block-markers.html b/tests/markdown-data/dense-block-markers.html index 964949c..14cbcae 100644 --- a/tests/markdown-data/dense-block-markers.html +++ b/tests/markdown-data/dense-block-markers.html @@ -48,3 +48,10 @@

changelog 2

+

paragraph

+

quote

+
+

paragraph

+
+

paragraph

+
html block
diff --git a/tests/markdown-data/dense-block-markers.md b/tests/markdown-data/dense-block-markers.md index ea365b8..db09cf8 100644 --- a/tests/markdown-data/dense-block-markers.md +++ b/tests/markdown-data/dense-block-markers.md @@ -53,4 +53,13 @@ headline2 ---- ## changelog 2 -* 17-Feb-2013 re-design \ No newline at end of file +* 17-Feb-2013 re-design + +paragraph +> quote + +paragraph +- - - + +paragraph +
html block
diff --git a/tests/markdown-data/images.html b/tests/markdown-data/images.html index e7c7679..96eb56f 100644 --- a/tests/markdown-data/images.html +++ b/tests/markdown-data/images.html @@ -2,9 +2,9 @@ Build Status

Here is an image tag: Total Downloads.

Images inside of links: -Total Downloads +Total Downloads

-Build Status +

Build Status Build Status

This is not an image: ![[ :-)

This is not an image: ![[ :-)]]