Browse Source

Markdown.pl: do not choke on \n inside attribute values

A tag such as this:

  <span style="
    lots: of;
    stuff: in;
    here: now;
  "></span>

Is perfectly valid.  Add the missing "s" pattern match
qualifier to make sure such attribute values do not end up
getting mangled.

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

2
Markdown.pl

@ -3734,7 +3734,7 @@ sub _SanitizeAtt {
sub _SanitizeAttValue { sub _SanitizeAttValue {
my $v = shift; my $v = shift;
if ($v =~ /^([\042\047])(.*?)\1$/) { if ($v =~ /^([\042\047])(.*?)\1$/s) {
return $1.escapeXML($2).$1; return $1.escapeXML($2).$1;
} else { } else {
return '"'.escapeXML($v).'"'; return '"'.escapeXML($v).'"';

Loading…
Cancel
Save