mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-22 08:04:18 +02:00
HTML-sanitize all text elements
This commit is contained in:
parent
9589289d60
commit
b25fcb31fb
1 changed files with 2 additions and 2 deletions
4
gold.go
4
gold.go
|
|
@ -246,7 +246,7 @@ func NewElement(node *bf.Node) Element {
|
|||
Pre: "",
|
||||
Post: "",
|
||||
Fragments: []Fragment{{
|
||||
Token: string(node.Literal),
|
||||
Token: stripper.Sanitize(string(node.Literal)),
|
||||
Style: Text,
|
||||
}},
|
||||
}
|
||||
|
|
@ -300,7 +300,7 @@ func NewElement(node *bf.Node) Element {
|
|||
Pre: "",
|
||||
Post: "",
|
||||
Fragments: []Fragment{{
|
||||
Token: string(node.Literal),
|
||||
Token: strings.TrimSpace(stripper.Sanitize(string(node.Literal))) + "\n",
|
||||
Style: HTMLSpan,
|
||||
}},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue