Index: gc_lang/fr/webext/content_scripts/panel_gc.js ================================================================== --- gc_lang/fr/webext/content_scripts/panel_gc.js +++ gc_lang/fr/webext/content_scripts/panel_gc.js @@ -57,15 +57,13 @@ start (xNode=null) { this.oTooltip.hide(); this.clear(); if (xNode) { - if (xNode.tagName == "TEXTAREA") { - this.oNodeControl.setNode(xNode); - } else { - this.oNodeControl.clear(); - this.addMessage("Cette zone de texte n’est pas un champ de formulaire “textarea” mais un node HTML éditable. Les modifications ne seront pas répercutées automatiquement. Une fois votre texte corrigé, vous pouvez utiliser le bouton ‹∑› pour copier le texte dans le presse-papiers."); + this.oNodeControl.setNode(xNode); + if (xNode.tagName != "TEXTAREA") { + this.addMessage("Note : cette zone de texte n’est pas un champ de formulaire “textarea” mais un node HTML éditable."); } } } clear () { @@ -432,11 +430,10 @@ constructor () { this.xNode = null; this.dParagraph = new Map(); this.bTextArea = null; - this.bWriteEN = false; // write editable node } setNode (xNode) { this.clear(); this.xNode = xNode; @@ -474,19 +471,21 @@ this.dParagraph.set(i, sText.slice(iStart)); //console.log("Paragraphs number: " + (i+1)); } write () { - if (this.xNode !== null && (this.bTextArea || this.bWriteEN)) { + if (this.xNode !== null) { let sText = ""; - this.dParagraph.forEach(function (val, key) { - sText += val + "\n"; - }); - sText = sText.slice(0,-1).normalize("NFC"); if (this.bTextArea) { - this.xNode.value = sText; + this.dParagraph.forEach(function (val, key) { + sText += val + "\n"; + }); + this.xNode.value = sText.slice(0,-1).normalize("NFC"); } else { - this.xNode.textContent = sText; + this.dParagraph.forEach(function (val, key) { + sText += val + "
"; + }); + this.xNode.innerHTML = sText.normalize("NFC"); } } } }