I need to remove nested <b></b> tags. See the generated css and you'll understand the problem:
<div class="highlight" contenteditable="true">
ahuasdhuasdhuasdhu
<b>
<b>#</b>
huadshuashud
</b>
</div>
I want remove the tags that have a '# inside, but I don't want remove the '#'. (Note the hashtag can be any another value). For this, I wrote the following code:
// Highlight already been declared and just is a simple $('.highlight').
highlight.children('b').children('b').contents().unwrap();
Now I have the following code:
<div class="highlight" contenteditable="true">
ahuasdhuasdhuasdhu
<b>
"#"
"huadshuashud"
</b>
</div>
I want join this two strings, because when I double click it, it just select "#" or "huadshuashud", but I want that all content inside the tag is selected.
Have some way to improve my method or concatenate these two strings?
""are literally in the HTML?