Browse Source

Markdown.pl: permit '#' suffix on backticks block language name

The language name specified for syntax highlighting generally has
to be composed of "word" characters (alphanumeric and "_") plus
"+", "-" and ".".

Allow a final trailing "#" on the language name so that c# and f#
can be used as language names.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
master
Kyle J. McKay 5 years ago
parent
commit
a8309fb9a6
  1. 2
      Markdown.pl

2
Markdown.pl

@ -646,7 +646,7 @@ sub _HashBTCodeBlocks {
$text =~ s{
(?:(?<=\n)|\A)
([ ]{0,$less_than_indent})``(`+)[ \t]*(?:([\w.+-]+)[ \t]*)?\n
([ ]{0,$less_than_indent})``(`+)[ \t]*(?:([\w.+-]+[#]?)[ \t]*)?\n
( # $4 = the code block -- one or more lines, starting with ```
(?:
.*\n+

Loading…
Cancel
Save