OxygenXML Web author highlighted text
Posted: Mon Dec 12, 2022 11:27 pm
Hi there,
I am trying to get the highlighted text (which could be a double click or selection with cursor).
when user does this highlight text operation, which is represented on UI with blue background color, how do i get the selected/highlighted text and not the whole text under the tag. For example in attached screenshot "Jennifer Angelini" is under a tag. But if the user highlights Angelini like in the screenshot, how do i get that particular part of the text ("Angelini")?
I have tried selection manager and highlights manager. Here is the code I used for highlights manager but somehow its not being called.
I am trying to get the highlighted text (which could be a double click or selection with cursor).
when user does this highlight text operation, which is represented on UI with blue background color, how do i get the selected/highlighted text and not the whole text under the tag. For example in attached screenshot "Jennifer Angelini" is under a tag. But if the user highlights Angelini like in the screenshot, how do i get that particular part of the text ("Angelini")?
I have tried selection manager and highlights manager. Here is the code I used for highlights manager but somehow its not being called.
Code: Select all
var highlightManager = e.editor.getEditingSupport().getWidgetsFactory().getHighlightsManager();
highlightManager.listen(sync.api.HighlightUpdateEvent.EventType.HIGHLIGHT_ADDED, function(e) {
console.log("highlight changed ", e);
});