Date: Fri, 29 Mar 2024 11:41:42 +0200 (EET) Message-ID: <100242753.664.1711705302557@ip-172-30-3-56.ec2.internal> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_663_663771671.1711705302554" ------=_Part_663_663771671.1711705302554 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Here is an example of using customInsertText event for managing the insert text mechanism flexibly.
var container =3D d= ocument.querySelector('.container'); // Get the main editable container. container.addEventListener('customInsertText', function(event) { // Call 'preventDefault' to prevent WProofreader from replacing text. // After that the text replacent mechanism can be handled manually. event.preventDefault(); // Obtain text for replacing from 'detail' field of the 'event' object. var text =3D event.detail.text; // Get the selection for the text insertion. // The text that is to be replaced are already in the browser Selection= . var selection =3D window.getSelection(); // Keep the error highlighting if needed. event.keepHighlight =3D true; });