0

I know there are other questions about tinyMCE, but this one is a little different. Let's say I create an unordered list that drops the closing li tags. I also have class attributes that I don't want to wrap in double quotes. This will be fine when I'm in the text editor, but when I switch to visual, TinyMCE will automatically add quotes and closing tags.

Is there a way to prevent this?

Also, even the text editor forces html indentation and I would like to avoid this as well.

  • Just a comment, but why? Single or double quotes make literally no difference, last li not wrapped is just invalid HTML, etc. – kero Feb 27 '18 at 16:38
  • 1
    html5 doesn't need any quotes unless you have a string with more than one word. so class=myclass is fine. Also, you don't need closing li tags anymore, and I leave them out because it makes it easier to write them without nesting errors. I understand why TinyMCE wants to correct broken HTML, but if my HTML is actually valid, I would like it to stay the way I prefer to write it. – 3x5 Feb 27 '18 at 19:18
  • Didn't know about them being optional, thanks for the hint! – kero Feb 27 '18 at 19:29
0

Sounds like you are using the wrong software ;) wordpress is not really designed nor should it be used as an html editor.

If for whatever reason you need some concrete HTML format you should either use a shortcode to generate it or create a page template to be used in the places where it is needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.