From 05747a4749c2ddc58dc02d490d4061e5c3c8584e Mon Sep 17 00:00:00 2001 From: Michel Fortin Date: Sat, 29 Oct 2016 14:24:27 -0400 Subject: [PATCH] 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 --- Michelf/MarkdownExtra.php | 2 +- Readme.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Michelf/MarkdownExtra.php b/Michelf/MarkdownExtra.php index 9b47a26..ac6b1b4 100644 --- a/Michelf/MarkdownExtra.php +++ b/Michelf/MarkdownExtra.php @@ -466,7 +466,7 @@ class MarkdownExtra extends \Michelf\Markdown { // after each newline to prevent triggering any block element. if ($span) { $void = $this->hashPart("", ':'); - $newline = "$void\n"; + $newline = "\n$void"; $parts[0] = $void . str_replace("\n", $newline, $parts[0]) . $void; } diff --git a/Readme.md b/Readme.md index fd8809f..e2f6384 100644 --- a/Readme.md +++ b/Readme.md @@ -192,6 +192,10 @@ Current Version: code block equivalent, there is no syntax for specifying a language. 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 `

` + where the element expects only span-level content. + * In the parser code, switched to PHPDoc comment format. Thanks to Robbie Averill for the help.