Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress visual editor strips html classes Re: WordPress visual editor strips html classes

#64680
Dominic
Member

Yes, latest version — 2.8.4 — Fresh install.

This is an example "flow", step-by-step, and the problem:

1. Copy some html from Coda
2. Paste it into TextEdit
3. Copy from TextEdit
4. In the wordpress visual editor, select Preformatted from the Format dropdown
5. Paste in the code.

Straight away, all the classes have been stripped.
So this:

Code:

..comes out like:

Code:
Left
Right

*If I didn’t mind losing all line formatting and spacing I can paste the full contents unstripped using the Paste as Plain Text button… less than ideal.

The issue is that it must (well… might) be javascript stripping the code as it’s pasted in.

Ideally, there is a way to stop this behaviour that doesn’t require hacking the wordpress core… a plugin perhaps?