Open mustufasathaliya opened 8 years ago
Did you try using the surroundContents method? Or the Class Applier Module?
I had used rangy Class Applier module, but it wrap only the text node. Can you please share me line of code to wrap entire selected content with single span
I am also curious how this can be done. Say I have paragraphs with different styles and I want them to be applied to the group of text nodes, not separately to each one of them
Does anyone have a solution? @romanovma @mustufasathaliya
Did you find any solution @mustufasathaliya @edsonharantes @romanovma?
The answer is using native Range API. @nishantmendiratta
Hi is there any way to wrap selected text with single span , even if it contain html tag between . For eg my text is
<strong>Hello</strong> test rangy highlighter
Now when i highlight above text , than rangy add two span as below
<strong><span class="highlight">Hello</span></strong><span class="highlight"> test rangy highlighter</span>
But i want that selected text should wrap with single span as
<span class="highlight"><strong>Hello</strong>test rangy highlighter</span>