From 7d7682ae9a1d9c8ec309050bcbfb1015cc522c45 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 2 Apr 2024 13:22:08 +0200 Subject: [PATCH] Skip markup in inline elements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 kar želite.`). --- service.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/service.js b/service.js index c4577a3..6b7d9ad 100644 --- a/service.js +++ b/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 .... - 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: '', - markup: true - }) return data }