TinyMCE wrap element in div element

I am using tinymce 3.3.6 (in Drupal) and I need a way to highlight a few paragraphs and wrap them in a new div with a class.

eg

<p>bob</p>
<p>bob</p>
<p>bob</p>

will (after selection and do something)

<div class="accordion">
<p>bob</p>
<p>bob</p>
<p>bob</p>
</div>

At the moment, if I just select everything and try to add a class, it just becomes:

<p class="accordion">bob</p>
<p class="accordion">bob</p>
<p class="accordion">bob</p>
+4
source share

Source: https://habr.com/ru/post/1760139/


All Articles