• Philip

    (@philipwalter)


    I have been beating my head against the wall for going on two weeks now trying to get control over the tag stripping/adding that goes on behind the scenes when using WordPress. The short story is that I have some fancy presentational stuff going on in some of a client’s pages. There’s some javascript as well as styling that necessitates <div>’s having id attributes, but tinyMCE seems to think they shouldn’t have them, or is it wp-autop thinks so? I want my client to be able to use the WYSIWYG editor to make minor edits to the content, such as changing dates, copy, etc. But every time he makes a changes in the visual editor it totally bungles my code. It’s infuriating.

    I’ve tried a few things based on searches here and elsewhere, such as manually adjusting wp-autop. I’ve tried rm_wpautop plugin to disable wpautop on a page by page basis. I am pretty well convinced, however, that it’s TinyMCE bungling things up. To address this I tried Advanced TinyMCE Config to change the valid_elements variable to be:

    a[id|style|rel|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],p[id|style|dir|class|align],-ol[class|style],-ul[class|style],-li[class|style],br,img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align],-sub[style|class],-sup[style|class],-blockquote[dir|style],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],-td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[style|class|align],-pre[class|align|style],address[class|align|style],-h1[id|style|dir|class|align],-h2[id|style|dir|class|align],-h3[id|style|dir|class|align],-h4[id|style|dir|class|align],-h5[id|style|dir|class|align],-h6[id|style|dir|class|align],hr[class|style],-font[face|size|style|id|class|dir|color],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],article[id|class|style],section[id|class|style],aside[id|class|style],footer[id|class|style],header[id|class|style],summary[id|class|style]

    Figured that would do the trick. Nope, still bungling things up. Anyway, just wondering if anyone has any suggestions or if anyone has other solutions to get around this issue. Surely I’m not the only one who can’t find a reliable solution to this? If so, apologies for my ignorance.

    Thanks in advance for any help.

    philip

Viewing 2 replies - 1 through 2 (of 2 total)
  • I agree. TinyMCE is a “touchy” platform for editing. Each time you switch between the visual and the html editors; code gets mangled.

    I have a plugin for TinyMCE I’ve been working on. You can find it here:

    https://www.ads-software.com/extend/plugins/ultimate-tinymce/

    I have been working on this same EXACT issue. It has to do with TinyMCE auto-stripping certain tags.

    Stay tuned to that plugin page for an update where this will be resolved; as I’m still working out a few remaining bugs.

    Thread Starter Philip

    (@philipwalter)

    Great. Thanks for your efforts! I’ll definitely check back often.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Reliable Controls for TinyMCE/wpautop Reformatting’ is closed to new replies.