Jump to content

TinyMCE - Wrapping tag / no p tag


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...

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

  • Create New...