Answer the question
In order to leave comments, you need to log in
How to find out what tags are already framed by the selected text?
I am making a visual html editor for a static site. Faced the problem of checking the selected text for the presence of tags framing it...
For example, there is formatted text. We selected "wor": <b>Hello |wor|ld !!!</b>
Next, you need to undo the "influence" of these tags on it using js (without jQuery libraries, and also without execCommand
, because I have unique tags there).
Thanks in advance)
Answer the question
In order to leave comments, you need to log in
The most correct (in terms of the number of bugs and the complexity of development) way is to keep the syntax tree of the text in memory and work with it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question