How can I preserve the formatting of the content within a shortcode block when I switch back and forth between the visual and text editor in TinyMCE? As in, the stuff between [myshortcode]
and [/myshortcode]
. I am using JSON inside the shortcode.
I've seen the Switch between Visual and HTML tab freely question and the Preserved HTML Editor Markup plugin. The plugin seems good, but I have hundreds of sites and hundreds of clients who own those sites and I don't want to risk messing up their content with the "Fix it" solutions required by that plugin. Really what I'm asking for seems to be special for the content section of shortcode blocks, so I'm hoping for a solution that's 'lighter' than the Preserved HTML Editor Markup plugin.
Here's an example of the 'before', while in text mode:
[myshortcode]
{
"map": {
"zoom": 5
}
}
[/myshortcode]
Now here's an example of switching to the visual mode:
[myshortcode]
{
"map": {
"zoom": 5
}
}
[/myshortcode]
After that, if you switch back to the text mode, you see:
[myshortcode]
{
"map": {
"zoom": 5
}
}
[/myshortcode]