Browse Source

Markdown.pl: clean up closing tag whitespace

While closing tags are matched okay if they contain whitespace,
that whitespace was not being cleaned up in a comparable way to
the manner in which whitespace in an opening tag is being handled.

Make whitespace in closing tags be handled the same way as
whitespace in opening tags.

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

1
Markdown.pl

@ -3678,6 +3678,7 @@ sub _Sanitize {
if ($tag =~ m{^</}) { if ($tag =~ m{^</}) {
my $autocloseflag = undef; my $autocloseflag = undef;
$autocloseflag = 1, $tag="</p>" if $tag eq "</\20>"; $autocloseflag = 1, $tag="</p>" if $tag eq "</\20>";
$tag =~ tr/\t\n\f\r //d; # remove whitespace
return (lc($tag),2,$autocloseflag); return (lc($tag),2,$autocloseflag);
} }
if ($tag =~ /^<([^\s<\/>]+)\s+/gs) { if ($tag =~ /^<([^\s<\/>]+)\s+/gs) {

Loading…
Cancel
Save