0
votes

I can highlight the selected text and remove it.However, after highlighting the selected text I want to save page and I want to be able to select it and unhighlight it when I restore it. But rangy does not unhighlight when I reload the saved page. How can I do this ? My error : enter image description here

1
Please post your code. I am using rangy and have not come across this issueControlAltDel
İf my text already highlighted I can not remove it. I will add gif wait a sec @ControlAltDelsnowl
I have confirmed that this is an issue with RangyControlAltDel
How can we solve this problem ? Can we store and restore highlight information to randy @ControlAltDelsnowl
How to solve the problem? Unfortunately, the best way to solve the problem is probably to start a project on GitHub, take over the code and fix it up. Timdown doesn't seem to have updated this in 5 or 6 years. There's someone else who made a clone, but that project looks like it hasn't been updated in at least 2 years. Other than that, don't use highlighter, or just accept the limitationsControlAltDel

1 Answers

0
votes

I solve this problem using jQuery like this :

function unhighlight() {
    var range = window.getSelection().getRangeAt(0);
    var node = $(range.commonAncestorContainer)

    if (node.parent().is('span')) {
        node.unwrap();
    }
}