Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

When you paste an image with a class attribute in the Wysiwyg editor, the pasted image no longer has this class attribute.

This makes it harder to copy and paste images that are aligned with the alignleft or alignright classes.

This used to work in WordPress 2.7, but it no longer works in WordPress 2.8 and up. It also works in the "base" version of TinyMCE (tested with 3.2.7 and 3.3.9.3), so it is probably something that is added by WordPress. I tested this in Safari, Firefox 3.6 and Chrome on Mac OS X.

This has been mentioned in a Trac ticket but the main item was dismissed as a browser issue - but I think the class issue is not.

Has anyone else found a way to make this work?

share|improve this question
    
@menardmam: What browser do you use? The Wysiwyg editor uses browser capabilities, it is possible that this works in one browser but not in the other. –  Jan Fabry Apr 7 '11 at 10:02
    
firefox all the way, never change, just updated –  menardmam Apr 7 '11 at 10:05
    
Wait, I'm not sure if I understood. You write something like <a src="#" alt="Something" class"myclass" /> and after you paste it to WP and publish tere is only <a src="#" alt="something />? And when you paste it how does it look? Screenshot from the place you prepare your code and WP could help a lot. –  Wordpressor Apr 7 '11 at 10:15
    
@menardman: I tested this myself and can confirm this. It stopped working in WP 2.8! This will probably be a bug in WordPress itself, once we figure it out we can maybe submit a patch to WordPress so it is fixed in the next release. –  Jan Fabry Apr 7 '11 at 11:00
3  
Pasting in HTML mode doesn't appear to exhibit this problem. –  t31os Apr 9 '11 at 12:21
show 2 more comments

1 Answer 1

up vote 1 down vote accepted

Instead of pasting into the Visual editor, switch to the html editor for pasting any kind of html, or using shortcodes.

I'd recommend checking the "disable the visual editor" checkbox in your user profile. Then install Mark Jaquith's Markdown on Save plugin for more readable formatting without the wysiwyg pitfalls.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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