Fixing two-space-at-end-of-line hard breaks inside of HTML blocks expecting span-level content.

- The code should insert the empty-string hash after the new line (at the beginning of the next line) true to its comment above. Instead it was added after, probably with various side effects such as breaking hard breaks.

Fix #252
This commit is contained in:
Michel Fortin 2016-10-29 14:24:27 -04:00
parent 8623708448
commit 05747a4749
2 changed files with 5 additions and 1 deletions

View file

@ -466,7 +466,7 @@ class MarkdownExtra extends \Michelf\Markdown {
// after each newline to prevent triggering any block element. // after each newline to prevent triggering any block element.
if ($span) { if ($span) {
$void = $this->hashPart("", ':'); $void = $this->hashPart("", ':');
$newline = "$void\n"; $newline = "\n$void";
$parts[0] = $void . str_replace("\n", $newline, $parts[0]) . $void; $parts[0] = $void . str_replace("\n", $newline, $parts[0]) . $void;
} }

View file

@ -192,6 +192,10 @@ Current Version:
code block equivalent, there is no syntax for specifying a language. code block equivalent, there is no syntax for specifying a language.
Credits to styxit for the implementation. Credits to styxit for the implementation.
* Fixed a Markdwon Extra issue where two-space-at-end-of-line hard breaks
wouldn't work inside of HTML block elements such as `<p markdown="1">`
where the element expects only span-level content.
* In the parser code, switched to PHPDoc comment format. Thanks to * In the parser code, switched to PHPDoc comment format. Thanks to
Robbie Averill for the help. Robbie Averill for the help.