Jump to content

TinyMCE and code <i> insertions


Smirftsch
 Share

Recommended Posts

After already having some issue with video embedding I switched my attention to be able adding (font awesome) icons.

However, something seems to be going absolutely wrong here, even when (temporary) disabling purifier and pastefilter (or editing pastefilter removing "i=em") a source code insertion like this:

<i style="font-size:24px" class="fa">&#xf042;</i>

becomes

<em class="fa" style="font-size: 24px;"></em>

 

so for some reason these settings are obviously not applied.

Using current 3.0.229 and corresponding TinyMCE rich text editor version 6.4.1.

What did I miss?

Link to comment
Share on other sites

Hi,

as pastefiler event only occurs when you... paste some content, this time it's not the guikty guy and you can keep it alive if you want ?

to allow, or force tinymce not to change your i tag into an em one, something that is in its default init config, just play with the field settings
in the Custiom settings JSON option

image.png.7884d5339d75f7fa4c0c790959eec61c.png

like aboven just add

{
  "extended_valid_elements": "i[id|class|style],em"
}

(keep the em in the list just in case...)
or, il like me you have some other options, just add the line with a comma if not the last one and now, your

<p>toto is happy <i class="fa-solid fa-circle-caret-right"></i></p>

piece of code will be safe ?

hope it helps

have a nice day

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...