Page 1 of 1

Not able to add tags for strikethrough and delete

Posted: Thu Jun 20, 2024 2:55 pm
by shilpa
Hi Oxygen Team,

I have registered two custom icons Strikethrough and Delete in oxygen web author plugin.
image.png
image.png
and in the actionPerformed i have added below respectively

actionPerformed(callback) {
jaEditor.getActionsManager().invokeOperation('ro.sync.ecss.extensions.commons.operations.ToggleSurroundWithElementOperation', {
element: '<deleted.material style="percent_op" xmlns="http://www.thomsonreuters.com/legal/jud ... d.material>'
});
callback();
}

actionPerformed(callback) {
jaEditor.getActionsManager().invokeOperation('ro.sync.ecss.extensions.commons.operations.ToggleSurroundWithElementOperation', {
element: '<strikethru xmlns="http://www.thomsonreuters.com/legal/jud ... strikethru>'
});
callback();
}
when i select text and click on icon text is not wrapping with the elements which is defined for the icons.

Please let me is there anything i have missed.

Thanks & Regards
Shilpa.P

Re: Not able to add tags for strikethrough and delete

Posted: Fri Jun 21, 2024 11:24 am
by mihaela
Hello,

in your code the value of the "element " parameter is not a valid XML element fragment (it has only the stat tag of the element included). You have to close the element or add the end element tag.
Also, the callback can be given as parameter of invokeOperation call:
https://www.oxygenxml.com/maven/com/oxy ... on__anchor

Best Regards,
Mihaela

Re: Not able to add tags for strikethrough and delete

Posted: Fri Jun 21, 2024 4:05 pm
by shilpa
Thank You Mihaela!!

Now it's working but i am getting some other issue
In case of deleted.text element the text is striking as you can see in the image.
image.png
In case of strikethru and deleted.material element the text is not getting strike below are the images for reference
image.png
image.png
may i know how to make strike to text using above two elements.
Please do the needful.

Thanks in advance!
Shilpa.P

Re: Not able to add tags for strikethrough and delete

Posted: Fri Jun 21, 2024 5:22 pm
by cosminef
Hello,

This can be achieved with CSS. We recommend using the CSS inspector function in Web Author so you can see how the <deleted.text> element is styled.
CSS-inspector.png
Best,
Cosmin