From 857a411dc5e7d4d4c8aa09b56ea5916e8d88566f Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sun, 14 Feb 2021 11:44:09 -0700 Subject: [PATCH] Markdown.pl: allow "stuff" on end of ``` line Some @#%^@! are doing something like this: ```shell script blah blah blah ``` That was not previously matching because only one optional "word" was allowed trailing the opening "```" characters. The single optional "word" is supposed to be a file extension type. Clearly ".shell script" is _not_ a file extension! Relax the rule somewhat. Multiple "words" are now allowed but only the first will ever participate in choosing the syntax highlighting (which currently never happens anyway). Signed-off-by: Kyle J. McKay --- Markdown.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Markdown.pl b/Markdown.pl index 63eff11..dfd69cb 100755 --- a/Markdown.pl +++ b/Markdown.pl @@ -1131,7 +1131,7 @@ sub _HashBTCodeBlocks { $text =~ s{ (?:(?<=\n)|\A) - ([ ]{0,$less_than_indent})``(`+)[ \t]*(?:([\w.+-]+[#]?)[ \t]*)?\n + ([ ]{0,$less_than_indent})``(`+)[ \t]*(?:([\w.+-]+[#]?)(?:[ \t][ \t\w.+-]*)?)?\n ( # $4 = the code block -- one or more lines, starting with ``` (?: .*\n+