Browse Source

Markdown.pl: add missing space to implied attributes

When sanitizing an attribute with an implied value such
as "compact" or "checked", add the required space at the
end to avoid mashing up against any other attribute that
might be present.

For example, <ol compact start=10> now becomes the correct:

    <ol compact="compact" start="10">

rather than the previously incorrect:

    <ol compact="compact"start="10">

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

2
Markdown.pl

@ -3797,7 +3797,7 @@ sub _SanitizeAtt {
return "" unless $univatt{$att} || $_[2]->{$att};
return "" if $_[3]->{$att}; # no repeats
$_[3]->{$att} = 1;
$impatt{$att} and return $att."=".'"'.$att.'"';
$impatt{$att} and return $att."=".'"'.$att.'" ';
(($_[4] eq "a" && $att eq "href") ||
($_[4] eq "img" && $att eq "src")) &&
$_[1] =~ /^\s*[\047\042]\s*javascript:/io and do {

Loading…
Cancel
Save