From 148a5f41e3b5e333abb426f610e5e36489f92877 Mon Sep 17 00:00:00 2001 From: Sunny Walker Date: Fri, 12 Oct 2018 14:27:54 -1000 Subject: [PATCH] rollback change to footnote names invalidating spaces in footnote names, while technically correct from HTML standards point of view is an unnecessarily burdensome breaking change at this time --- Michelf/MarkdownExtra.php | 2 +- test/resources/php-markdown-extra.mdtest/Footnotes.text | 6 ------ test/resources/php-markdown-extra.mdtest/Footnotes.xhtml | 4 ---- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Michelf/MarkdownExtra.php b/Michelf/MarkdownExtra.php index 108e5d1..d25b4ec 100644 --- a/Michelf/MarkdownExtra.php +++ b/Michelf/MarkdownExtra.php @@ -1645,7 +1645,7 @@ class MarkdownExtra extends \Michelf\Markdown { */ protected function doFootnotes($text) { if (!$this->in_anchor) { - $text = preg_replace('{\[\^(\S+?)\]}', "F\x1Afn:\\1\x1A:", $text); + $text = preg_replace('{\[\^(.+?)\]}', "F\x1Afn:\\1\x1A:", $text); } return $text; } diff --git a/test/resources/php-markdown-extra.mdtest/Footnotes.text b/test/resources/php-markdown-extra.mdtest/Footnotes.text index c54e436..95b5ea8 100644 --- a/test/resources/php-markdown-extra.mdtest/Footnotes.text +++ b/test/resources/php-markdown-extra.mdtest/Footnotes.text @@ -68,9 +68,3 @@ Footnotes mixed with images[^image-mixed] [img6]: images/MGR-1800-travel.jpeg "Travel Speeds in 1800" [^image-mixed]: Footnote Content [img7]: images/MGR-1830-travel.jpeg "Travel Speeds in 1830" - - - - - - -This is not a valid footnote name because it has whitespace.[^invalid fn] - -[^invalid fn]: an invalid footnote name diff --git a/test/resources/php-markdown-extra.mdtest/Footnotes.xhtml b/test/resources/php-markdown-extra.mdtest/Footnotes.xhtml index 2e16a92..fe0a464 100644 --- a/test/resources/php-markdown-extra.mdtest/Footnotes.xhtml +++ b/test/resources/php-markdown-extra.mdtest/Footnotes.xhtml @@ -30,10 +30,6 @@ footnote test111800 Travel1830 Travel

-
- -

This is not a valid footnote name because it has whitespace.[^invalid fn]

-