开发者

Wrapping a tag inside a tag in TinyMCE

开发者 https://www.devze.com 2023-02-22 09:51 出处:网络
I\'m trying to figure out how I can wrap another HTML tag within when a users click on the ordered list button in TinyMCE.

I'm trying to figure out how I can wrap another HTML tag within when a users click on the ordered list button in TinyMCE.

Example:

<ol>
    <li>something</li>
</ol>

Will become:

<ol>
    <li><span>something</span></li>
</ol>

The reason is that I need the text in the span to different from the numbered bullet. I found a wrapInner() jQuery solution but it doesn't work because I need it to show up in the editor.

I am running the jQuery versio开发者_Go百科n of TinyMCE.

Thanks in advance for the help.


You could write your own plugin which could replace the ordered list plugin. All you need to do is to get the code from the recent plugin and modify it slighty to insert spans also. That's it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号