saveguard oob on markup render
This commit is contained in:
parent
1247f9d48f
commit
5151d47427
|
@ -262,6 +262,11 @@ func RenderCmplxWithConfig(content text.Rich, cfg RenderConfig) RenderOutput {
|
||||||
var lastIndex = 0
|
var lastIndex = 0
|
||||||
|
|
||||||
for _, index := range appended.Finalize(len(content.Content)) {
|
for _, index := range appended.Finalize(len(content.Content)) {
|
||||||
|
// Prevent faulty backend with erroneous insertions.
|
||||||
|
if index > len(content.Content) {
|
||||||
|
index = len(content.Content)
|
||||||
|
}
|
||||||
|
|
||||||
// Write the content.
|
// Write the content.
|
||||||
buf.WriteString(html.EscapeString(content.Content[lastIndex:index]))
|
buf.WriteString(html.EscapeString(content.Content[lastIndex:index]))
|
||||||
// Write the tags.
|
// Write the tags.
|
||||||
|
|
Loading…
Reference in New Issue