forked from Mirrors/gomuks
Fix codeblocks doubled newlines in plaintext mode
This commit is contained in:
parent
58c20698d6
commit
1cff17a857
1 changed files with 5 additions and 3 deletions
|
@ -312,11 +312,13 @@ func (parser *htmlParser) syntaxHighlight(text, language string) Entity {
|
|||
continue
|
||||
}
|
||||
t := token.Clone()
|
||||
t.Value = line
|
||||
children = append(children, tokenToTextEntity(style, &t))
|
||||
|
||||
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…
Add table
Reference in a new issue