WordPress.org

Ready to get started?Download WordPress

Forums

TinyMCE Advanced
Paste From Word (37 posts)

  1. StrangeVandal
    Member
    Posted 10 months ago #

    I'm honestly not sure if this is a problem with the plugin or the new TinyMCE version, but since I wasn't able to paste from Word/OpenOffice before installing this, I imagine it belongs here.

    Anyway, after updating, the Paste From Word button is gone. Paste As Text now appears to be a toggle between this and pasting as text, but the generated code is a mess that removes all my spacing. This didn't happen before the update.

    I'm not so much concerned with the ugly code as the loss of spacing. It seems to be ignoring or removing both paragraphs and /br tags. It looks fine in the Visual Editor, but not in the published doc.

    https://wordpress.org/plugins/tinymce-advanced/

  2. Andrew Ozz
    WordPress Dev
    Plugin Author

    Posted 10 months ago #

    Yes, the Paste from Word popup is gone in TinyMCE 4.0. You should be able to paste directly in the editor (with Crtl + V) and it will cleanup the pasted content. If you prefer to paste as text, try pasting in the Text editor.

  3. anhtuan020588
    Member
    Posted 10 months ago #

    Please please please bring Paste from Word button back :(

  4. dice2dice
    Member
    Posted 10 months ago #

    I'm incredulous that they've removed paste from word radio button.

    The Moderators keep insisting it isn't required and you paste straight from Word to WordPress since 3.9.

    It is nonsense because it doesn't work.

    I can't believe they didn't test such an important feature before bringing it in.

    I have spent all day reviewing text editors because I can't get my posts to appear properly.

    They need to roll this back ASAP!!!

  5. esmi
    Forum Moderator
    Posted 10 months ago #

    I'm incredulous that they've removed paste from word radio button.

    "They" didn't. TinyMCE 4 now allows for direct pasting from Word without having to click on any specific button.

  6. dice2dice
    Member
    Posted 10 months ago #

    No you are wrong there. 'They' did remove the paste from Word radio button.

    You could always paste from Word before 3.9 but you would be silly to do so because it would be all messed up.

    Now all they've done in 3.9 is remove the paste from Word radio button and instructed everyone to paste directly from Word and guess what? It's all messed up, it doesn't work.

  7. esmi
    Forum Moderator
    Posted 10 months ago #

    'They' did remove the paste from Word radio button.

    Because it was no longer needed.

    Now all they've done in 3.9 is remove the paste from Word radio button and instructed everyone to paste directly from Word

    No - that's simply incorrect. http://wptavern.com/wordpress-3-9-has-built-in-support-for-pasting-from-microsoft-word

  8. dice2dice
    Member
    Posted 10 months ago #

    @esmi I have tried six times, it doesn't work.

    You can tell me it works utill the cows come home, I am telling you that you are wrong and that it doesn't work.

  9. dice2dice? While pasting from Microsoft Word may not work for you it does work for just about everyone else by design. I use that feature at least once a week.

    Have you tried any troubleshooting steps to identify why it's not working for you?

  10. dice2dice
    Member
    Posted 10 months ago #

    No Jan Dembowski. I didn't know there were issues to Troubleshoot or that it worked for anyone.

    I've found others posting that they have issues with it but I haven't noticed anyone who uses it stating it works.

  11. esmi
    Forum Moderator
    Posted 10 months ago #

    You have now. :-)

    Can you replicate the problem using the default Twenty Fourteen theme with all plugins deactivated?

  12. rrwriter
    Member
    Posted 10 months ago #

    I am using the default Twenty Fourteen theme. No, I have not yet tried pasting with all plugins disabled. I have embarrassed myself enough by repeated postings that lose all formatting each time I change one item, though I don't realize the formatting will be gone until I look in a separate browser. (meaning that preview shows an inaccurate view of what's really on the site.) I will eventually test to see whether any of the seven plugins I am using may be causing this problem. Right now I'm here to say I don't see any addressing of this bug, whatever it is, and the 3.9.1 update, and that seems wrong, given the extent to which different users are facing similar problems with pasting. For the record, I am using a Mac/10.9.2, Firefox/29.0, and, of course, WordPress 3.9, Twenty Fourteen theme.

  13. phbyerly
    Member
    Posted 9 months ago #

    I enter test in WordPress. I copy and paste to Word. I copy and paste back to WordPress, and now I see:

    <p style="line-height: 14.25pt;"><span style="font-size: 10.0pt; font-family: 'Georgia','serif'; color: #333333;">

    In my code. When I had and used the Paste from Word button I did not get this garbage.

    I understand why you suggest changing themes and turning off all my plugins, but this is an active blog and I do not want to do that to my readers.

    One more "no it does not work" voice. How many will it take before we are believed?

  14. TrishaM
    Member
    Posted 8 months ago #

    Some people will claim "it works", others that "it doesn't work".

    The bottom line is that it DOESN'T work the way it USED TO. And it my opinion, that means it doesn't work.

    Sure, you can paste directly from Word into WP. But it DOES NOT then create cleaned up HTML the way it used to.

    For example - bulleted lists used to then appear using the proper li (list items). They don't any longer, now in the Text (formerly HTML) tab, they show the ascii characters representing a bullet. That is NOT the same thing, and themes that style lists based on ul, ol, and li won't display the lists properly.

    The button needs to be put back in. I used this extensively as often content is submitted via Word Docs and has to be pasted in. Now it's a mess and requires a lot of very time-consuming cleanup to remove extraneous Word crap such as non-needed style declarations, non-standard markup, and incorrect HTML tags.

    I vote +1 on bringing back the paste-from-Word button.

  15. JSheridanFR
    Member
    Posted 8 months ago #

    Same here... and I don´t understand why "in a very weird way it works" (to copy directly) leads directly to the end this button (and why it is not brought back yet - for those who are ok with the weird way direct copying works it would do no harm to have the button - vice versa it´s an entirely different story...)

    So a loud +1 on bringing back the paste-from-Word button

  16. bitpath
    Member
    Posted 8 months ago #

    Many people have reported pasting images from the clipboard no longer works in 3.9 either, and this all comes back to the new TinyMCE. There were plugins that enabled this, which are supposedly no longer necessary, but those don't seem to work anymore either, similar to this, the button being "unnecessary" now without the functionality being actually replaced.
    Can we revert just TinyMCE back ourselves somehow? I'd hate to overwrite core files with an old version of tinymce but is that a reasonable option? It seems less dangerous than trying to revert WordPress. The issues seem introduced with 3.9 but seem to be the TinyMCE part of the update. I am thinking the loss of the cleaned up paste from word the loss of being able to paste images from the clipboard, all beginning with 3.9 just the TinyMCE update.
    There is a bug ticket open for the pasting of clipboard images (encoded like <img alt="" src="data:image/png;base64,xxx...). Maybe when this is fixed it will also fix pasting other Word elements, or is there a bug ticket for this odd paste to/from Word behavior too?

    https://core.trac.wordpress.org/ticket/27970

    Others are running into issues, and contradict the assumption that the new TinyMCE makes paste from Word or clipboard image paste plugins unnecessary, since the old functionalities are not actually there anymore. Reverting TinyMCE in core would probably fix all this until the functions are correctly replaced and implemented in the new TinyMCE 4.x. Can a plugin be used to replace core TinyMCE verson? I don't think they can add back the button without actually reverting TinyMCE.

    https://wordpress.org/support/topic/unable-to-paste-rich-text-in-wp-39

  17. michiamano
    Member
    Posted 8 months ago #

    I have a client (fiction author) who is being driven to all caps distraction by this. Pasting directly from Word 2010 regularly deletes spaces between words, deletes single word paragraphs altogether.

    She's been doing her blog this way since 2008 and we've NEVER had a problem pasting from Word until this upgrade.

    I have replicated this problem on a test blog with the 2014 theme and no plugins. Other people have replicated it on her blog.

    Interestingly, one tester reported that she didn't get that problem on WordPress.com.

    I have tried upgrading to the latest version of tinymce but that seems to have its own issues - the toolbar in the Visual editor simply disappears. I don't have the patience to troubleshoot.

    It's frustrating to read 'it works' over and over when there are obviously people who are having serious issues.

  18. laubenicolas
    Member
    Posted 8 months ago #

    Working or not working. Since WP 3.9 I have definitely noticed that the issues with paragraph and line spacing hasbecome worse.

    NO matter who it is working for, there are enough people having a problem with it, that makes it worth looking into fixing.

    For me that is probably the biggest issue that speaks against using wordpress for building sites. Although I absolutely love it, but if it takes 2 to 3 hours just fixing spaces and paragraphs for one page, I need to consider a cms that lets me progress faster.

    I hope that issue is fixed very soon, as I really love WP and would hate to have to change.

  19. jlvdaum
    Member
    Posted 7 months ago #

    I see that nobody has written on this in a while, so I'm hoping someone has found a solution. Perhaps someone can tell me how to roll back to a previous version of WordPress if there is no other way?

    I find it wildly insulting that so many people in the thread just blindly insist it is working in the face of so many who are complaining that it doesn't. If the public can't make it work, it's broken.

    Inability to post from Word as I used to is essentially fatal to my site so I'd appreciate any advice.

  20. bitpath
    Member
    Posted 6 months ago #

    Sorry. Been really busy but getting back to reviewing the possibility of a plugin.
    For now, please try adding this to your functions.php to see if it helps.
    After looking things over it seems like it was default configuration issues. The below code should enable image copy paste from clipboard, formatted copy/paste from word and excel. It's a bit of a "nuclear option" just enabling all the wysiwyg copy/paste I could think of for now, and I'll try to get a more refined solution here soon. Also, i'm still learning so I apologize for any crudeness to the code.
    Please note this was just what I did to fix my issues with the new editor that may or may not be related to your issue. I really hope it helps your situation some though.
    It's just to enable copy/paste of images and other style elements by default. If you don't want any style elements, paste as text should still work.

    /**
    * Adjust wordpress 3.9x+ editor to allow pasting images and other office document wysiwygy elements
    */
    function enable_tmce_paste_stylesAndImages($mceInit, $editor_id){
        $mceInit['paste_data_images'] = true;
                    $mceInit['paste_word_valid_elements'] =  "b,strong,i,em,h1,h2,p,ol,ul,li,a,span,div,font-size,br,img,table,tbody,td,tfoot,th,thead,tr,del,ins,dl,dt,dd";
                    $mceInit['paste_webkit_styles'] = "all";
                    $mceInit['paste_retain_style_properties'] = "all";
    
        return $mceInit;
    }
    add_filter('tiny_mce_before_init', 'enable_tmce_paste_stylesAndImages', 1, 2);
  21. Andrew Ozz
    WordPress Dev
    Plugin Author

    Posted 6 months ago #

    @bitpath this pretty much disables the cleanup on paste. Would still work ok in Firefox and IE but will insert tons of bad markup in Chrome/Safari.

  22. bitpath
    Member
    Posted 6 months ago #

    I totally get that it disables the cleanup.
    I really dig your plugin by the way.
    TinyMCE default cleanup was way too restrictive for me, preventing me from pasting screen print images, excel tables and other elements. I'd rather paste as text (cleaned up) when I want or use the little eraser.
    I appreciate the warning about pasting bad code from IE and Firefox and feel mileage will vary on that one. For some just being able to copy and paste images from clipboard or certain elements from Word/Excel might be more important to workflow than the underlying code being pretty. I don't mind it encoding images right in the HTML in a pinch to paste a quick screenshot, but realize it might make some cringe :). I use mostly Firefox and Safari and switch back and forth wysiwyg and text modes often and haven't noticed a lot of extra markup in my normal usage, but will keep an eye out.
    Thank you for a great plugin!

  23. bitpath
    Member
    Posted 6 months ago #

    I'd prefer a "paste all wysiwyg" button to selectively enable these elements and bypass default filtering only if needed, but with my limited skill-set, disabling the cleanup as much as I could think of solved my current need.

  24. Andrew Ozz
    WordPress Dev
    Plugin Author

    Posted 6 months ago #

    Hmm, a button is not a bad idea, not sure if it can be done right though. Resurrecting the old popup is another alternative. Then the level of cleanup can be selected in the popup. It can even be made to show a preview of the HTML that is going to be inserted.. All that is for advanced users, of course.

  25. bitpath
    Member
    Posted 6 months ago #

    That would be really cool!

  26. Alberto
    Member
    Posted 6 months ago #

    Thank you Bitpath, you are the man of the day!

    I hope a solution to this can be found by WP coders and make it offical in following releases.

  27. bitpath
    Member
    Posted 6 months ago #

    Ozz is already considering how to best implement something like this, and he's the true TinyMCE guru here. I know just enough to fiddle. There are potential problems with my workaround, sometimes bringing over undesired styles or messy code, especially for end users not comfortable reviewing text mode or using the format eraser.
    I look forward to however he sees best to give a few more filter options! This really isn't the best default config for many, disabling all the cleanup by default, it's just easier for my current workflow. Thank you so much and glad it helped!

  28. Alberto
    Member
    Posted 6 months ago #

    I update a small, monthly school bulletin/blog and material is provided in Word by students so ability to be able to copy images and paste them directly into the post is a time saver and I do try to clean code by pasting into a text editor before I insert into post. I am sure I am not the only one receiving material in Word so I do hope a solution is found and not take away features from WP.

    Ozz may be the guru but this week you are MY guru *lol* thanks a bunch, once again!! ...yes, it certainly did help :)

    Good luck Ozz, in finding a solution, ability to paste images from Word is a "must have" feature to develop/implement/keep.

  29. Andrew Ozz
    WordPress Dev
    Plugin Author

    Posted 6 months ago #

    For now added another checkbox to turn pasting of image sources on :(

    Not a good solution, don't like having tons of checkboxes/settings that most users don't care about, but making this in a TinyMCE plugin with a popup is not an easy task.

  30. bitpath
    Member
    Posted 6 months ago #

    Thank you for adding that!
    I agree, too many options in your face is clutter, especially small use case ones.
    I was thinking more of a single "fine, let it all through then" option at first, to let as much as possible come through to help troubleshoot various issues, like missing charts, pictures, empty paragraphs, styles, etc., and then switching to html to see what it was coming over as to see what was being blocked. That's how I'd use it, but I don't know how many people would make use of that or just be lazy leaving it all unfiltered and leaving a crazy mess of code in their wake.
    Well, thank you again. Even without any more options your plugin is quite a help as-is. thank you also for explaining the implications of string encoding the clipboard images right next to the option!! I'm wondering if the "stop removing p and br tags..." option will help people reporting empty paragraphs and line breaks disappearing after the update. If that options was already there I hope people will take a second look at it too!

Reply »

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.