From a954f6d698724522a0fc80d44021ae2625346fa9 Mon Sep 17 00:00:00 2001 From: Sunny Walker Date: Fri, 12 Oct 2018 09:04:19 -1000 Subject: [PATCH] do not accept named footnotes with whitespace whitespace creates invalid HTML ids --- Michelf/MarkdownExtra.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Michelf/MarkdownExtra.php b/Michelf/MarkdownExtra.php index 9a4be84..32eca11 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('{\[\^(.+?)\]}', "F\x1Afn:\\1\x1A:", $text); + $text = preg_replace('{\[\^(\S+?)\]}', "F\x1Afn:\\1\x1A:", $text); } return $text; }