Remove unnecessary spaces in headers
This commit is contained in:
parent
eacefbbbe8
commit
e5291798cb
2 changed files with 6 additions and 5 deletions
|
@ -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=+$/)) {
|
||||
|
|
8
test.sh
8
test.sh
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue