Jump to content

TinyMCE - Wrapping tag / no p tag


Grzegorz
 Share

Recommended Posts

Hello everyone.

I'm moving form CKEditor to TinyMCE and I'm struggling to replicate my setup for headings.
Previously I had a field that would output text without any p tags which is nice for things like heading tags where all I need inside is pure text and sometimes a span, a, strong tag etc. 
That output was wrapped by H tag, I find it convenient as its one less thing for user to click also user doesn't have to remember which tag would be correct in this scenario and also user won't pick other h tag just because it looks a bit different...

Right now only solution I have is to use php strip_tags() but I would like to do this using TinyMCE.

Tiny documentation says removing p tag as the root block may break the editor so I'm thinking if editor requires to always have a block wrapper can p tag be swapped to span?
Does anyone know how to do it without breaking the editor?

Edited by Grzegorz
added tags
Link to comment
Share on other sites

  • 4 months later...
  • 11 months later...

Hey,

I just came across this thread because I ran into this issue.   It turns out if you feed the configuration a single spaced empty string it will not wrap the WYSIWYG content in the paragraph tags.

And for whatever reason, span was causing my system to become unresponsive.  

I didn't see this mentioned here or in the TinyMCE forum so figured I'd share here incase it helps save someone some time.

Go to:

Modules > Configure > InputfieldTinyMCE 

scroll down to Default setting overrides...

Screenshot 2024-03-26 at 5.50.30 PM.png

Hack the Planet!

Edited by lray138
updating the path to where to make the edit.
  • Like 2
Link to comment
Share on other sites

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

×
×
  • Create New...