Update parser.v
This commit is contained in:
+4
-7
@@ -29,19 +29,16 @@ fn parse(lines []string) string {
|
|||||||
|
|
||||||
lvl, mut text := parse_header(trimmed)
|
lvl, mut text := parse_header(trimmed)
|
||||||
|
|
||||||
if lvl > 0 {
|
is_header := lvl > 0
|
||||||
output += '<h' + lvl.str() + '>'
|
|
||||||
}
|
|
||||||
|
|
||||||
if lvl > 0 {
|
if is_header {
|
||||||
|
output += '<h' + lvl.str() + '>'
|
||||||
output += text + '</h' + lvl.str() + '>'
|
output += text + '</h' + lvl.str() + '>'
|
||||||
} else {
|
} else {
|
||||||
output += text
|
output += text
|
||||||
}
|
|
||||||
|
|
||||||
if lvl == 0 {
|
|
||||||
output += '<br>'
|
output += '<br>'
|
||||||
}
|
}
|
||||||
|
|
||||||
output += '\n'
|
output += '\n'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user