Hi @shaheena_sheikh,
Based on the approach shared in one of the comments in that blog post, below works fine in my local 6.5.0.
It won't work on the already applied text as we don't have an explicit feature for removal as part of this custom plugin (like we have unlink in case of Link Plugin)
We might have to explicitly remove from JCR.
For local testing, you can try applying tooltip to a fresh text and then amend on top of it.
Replace the existing if logic for submit action with the below
if(action === "submit"){
var ek = $eaemStructuredModal.eaemModalPlugin.editorKernel,
editContext = ek.getEditContext(),
selectedText = CUI.rte.Selection.createProcessingSelection(editContext),
startNode = selectedText.startNode,
tooltipHtml = getHtmlFromContent(window.getSelection().toString(), message.data);
if(startNode.parentNode.nodeName == "SPAN" && startNode.parentNode.className == "eaem-dotted-underline"){
startNode.parentNode.setAttribute("title", message.data.title + " : " + message.data.description);
startNode.parentNode.setAttribute("data-content", JSON.stringify(message.data));
}
else {
ek.execCmd('inserthtml', tooltipHtml);
}
// ek.execCmd('inserthtml', tooltipHtml);
ek.focus();
}