Skip markup in inline elements

It may end up in grammar suggestions. Thou, this partially removes
markup when user confirms suggestion it happens rarely - when grammar
mistakes spans across inline element boundaries (e.g. `Popravite
<a href=".">kar želite</a>.`).
This commit is contained in:
Simon Rozman 2024-04-02 13:22:08 +02:00
parent 35c518e0e0
commit 7d7682ae9a

View File

@ -184,17 +184,10 @@ class BesService {
this.statusDiv.title = 'BesService je registriran.'
return [{ text: '<' + node.tagName + '/>', node: node, markup: true }]
} else {
// Surround inline element with dummy <tagName>...</tagName>.
let data = [
{ text: '<' + node.tagName + '>', node: node, markup: true }
]
for (const el2 of node.childNodes) {
// Inline elements require no markup. Keep plain text only.
let data = []
for (const el2 of node.childNodes)
data = data.concat(await this.proof(el2))
}
data.splice(data.length, 0, {
text: '</' + node.tagName + '>',
markup: true
})
return data
}