Fix codeblocks doubled newlines in plaintext mode
This commit is contained in:
parent
58c20698d6
commit
1cff17a857
@ -312,11 +312,13 @@ func (parser *htmlParser) syntaxHighlight(text, language string) Entity {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
t := token.Clone()
|
t := token.Clone()
|
||||||
t.Value = line
|
|
||||||
children = append(children, tokenToTextEntity(style, &t))
|
|
||||||
|
|
||||||
if line[line_len-1:] == "\n" {
|
if line[line_len-1:] == "\n" {
|
||||||
children = append(children, NewBreakEntity())
|
t.Value = line[:line_len-1]
|
||||||
|
children = append(children, tokenToTextEntity(style, &t), NewBreakEntity())
|
||||||
|
} else {
|
||||||
|
t.Value = line
|
||||||
|
children = append(children, tokenToTextEntity(style, &t))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user