Remove unnecessary spaces in headers

This commit is contained in:
Konstantin Nazarov 2021-07-10 22:47:07 +00:00
parent eacefbbbe8
commit e5291798cb
Signed by: knazarov
GPG key ID: 4CFE0A42FA409C22
2 changed files with 6 additions and 5 deletions

View file

@ -8,7 +8,8 @@ function parse_header(str, hnum, content) {
match(str, /#+/);
hnum = RLENGTH;
content = parse_line(substr(str, hnum + 1, length(str) - hnum ));
gsub(/^#+ */, "", str);
content = parse_line(str);
return "<h" hnum ">" content "</h" hnum ">";
}
if (match(body, /^[^\n]+\n=+$/)) {

View file

@ -72,7 +72,7 @@ check <<-EOF
# Header
body
---
<h1> Header</h1>
<h1>Header</h1>
<p>body</p>
EOF
@ -81,9 +81,9 @@ check <<-EOF
## Header2
### Header3
---
<h1> Header1</h1>
<h2> Header2</h2>
<h3> Header3</h3>
<h1>Header1</h1>
<h2>Header2</h2>
<h3>Header3</h3>
EOF
check <<-EOF