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:
parent
35c518e0e0
commit
7d7682ae9a
13
service.js
13
service.js
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user