Pasting into Visual editor tab strips parameters as if interpreting text as HTML
-
When writing my recent post on making your bullet lists sexier, I noticed some bizarre behavior from the WordPress Visual editor.
I was expecting that the Visual editor would act like a WYSIWYG editor, and treat pasted text as text, without interpreting and modifying HTML-looking text. After all, if I want to edit HTML, I’ll use the HTML tab, right?
But if I use the Visual tab of the WordPress editor to create a new paragraph of type Preformatted and paste the following text from a text editor into it:
<ul class="bad">
,
the ‘class=”bad”‘ parameter is magically removed and I end up with:
<ul>
This is in the Visual tab of the editor, not the HTML tab; surely it shouldn’t even be interpreting text I paste as HTML, let alone munging it. This is a real pain-in-the-neck when trying to show code in the Visual editor; at first I didn’t even notice that copy-and-paste was breaking my code. Is there some way to disable this behavior and stop the WordPress Visual editor damaging pasted text that happens to look like HTML?
Cheers, Graham
- The topic ‘Pasting into Visual editor tab strips parameters as if interpreting text as HTML’ is closed to new replies.