Forums | Mahara Community

Support /
Copy and pasting text


Wullie's profile picture
Posts: 252

23 January 2014, 2:56

Hi,

When I try to copy and paste text from a Word document, nearly all of the text formatting gets stripped out, whether pasting directly or through the Paste From Word option (although the later pastes into the Paste From Word dialogue box, it gets stripped out when returning to the edit box).

As far as I can see bolding stays in, but the font family is stripped out (regardless if the font-family exists in Mahara or not - I thought maybe it was a Word available font but not Mahara, but that doesn't seem to be the case). With regards to colour and font-size, sometimes they stay in and sometimes stripped out.

Any suggestions? It seems a pain for a student used to Word typing and setting the look and feel of their work, only to have to redo the formatting again withn Mahara (and yes, I know they should just type straight into Mahara ;))

Thanks

Aaron Wells's profile picture
Posts: 896

23 January 2014, 11:12

Hi Wullie,

I took a look at the "Paste from Word" button. It's the standard TinyMCE "paste" plugin: http://www.tinymce.com/wiki.php/Plugin3x:paste

There are three improvements we could make to it:

  1. Currently we're on TinyMCE 3.5.8. The latest 3.5.x version is 3.5.10, and it actually does have one bugfix for the Paste from Word functionality, which seems to be for not stripping out lists.
  2. Also, according to the TinyMCE wiki, the "paste" plugin was rewritten some time ago so that if configured properly, you can just paste directly into TinyMCE and not have to specifically use that "Paste from Word" button. So, we may need to change our configuration to do that.
  3. I also see in the documentation there's a "paste_retain_style_properties" setting for the plugin. Possibly setting that to "all" would cause it to retain all MS styling?

Out of those, I think number 3 is most likely to be helpful to you. Try adding "paste_retain_style_properties: all" to the $tinymce_config section within the smarty() function in htdocs/lib/web.php and see if that makes a difference. I'd try it, but I don't have a copy of Word on hand. :)

Cheers,

Aaron

2 results