Browse Source

Markdown.pl: hook up all atx-style headers with ids

Previously, to match setext-style headers, only the top
three levels of atx-style headers were hooked up with ids.

Change this and hook up h4, h5 and h6 atx-style headers using
the same rules as for the others.

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

2
Markdown.pl

@ -1451,7 +1451,7 @@ sub _DoHeaders {
}{
my $h = $2;
my $h_level = length($1);
my $id = $h_level <= 3 ? _GetNewAnchorId($h) : '';
my $id = _GetNewAnchorId($h);
&$geth1($h) if $h_level == 1;
$id = " id=\"$id\"" if $id ne "";
"<h$h_level$id>" . _RunSpanGamut($h) . "</h$h_level>\n\n";

Loading…
Cancel
Save