Item9204: TinyMCE strips out 'type' arguments when pasting Foswiki macros from MS Word

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Extension TinyMCEPlugin Main.PaulHarvey
I'm sure this is probably TinyMCE's favorite topic but I'm having an issue with pasting from MSWord into the Foswiki 1.0.9 version of TinyMCE (3.2.7?). If I paste this search macro into TinyMCE:

%SEARCH{"1" type="query" date="2006-10-10" format="$topic"}%

I get:

%SEARCH{"1" date="2006-10-10" format="$topic"}%

The type="query" argument has been stripped out. It seems to be picking on 'type' arguments in particular as rearranging the order of the arguments has no affect and type is still removed. Adding a type argument to other macros and pasting them in also results in the type argument being stripped out when it is displayed in the editing window.

-- BryanThale - 25 Jun 2010

Hi Brian, do you have time to try this on http://trunk.foswiki.org/Sandbox

Also compare with http://trunk.foswiki.org/Sandbox/PastePluginDisabled

-- PaulHarvey - 26 Jun 2010

It seems to work correctly for http://trunk.foswiki.org/Sandbox

What is http://trunk.foswiki.org/Sandbox/PastePluginDisabled ? Is that a work-around setting I can apply to FW 1.0.9?

-- BryanThale - 26 Jun 2010

I copied the setting to a local WebPreferences topic and now I get this:

%SEARCH{"1" type="query"
date="2006-10-10" format="$topic"}%

The 'type' is still there, but there is a spurious line break. The line break does not seem to interfere with the operation of the macro though.

-- BryanThale - 26 Jun 2010

Hi Bryan, it seems that TinyMCE 3.2.7's paste plugin has some strange defect pasting from office documents.

The paste plugin is supposed to make such paste scenarios "cleaner" (less noisy) in conversion to HTML.

I suppose if you can live without it - not sure it does a whole lot of good unless you're using Internet Explorer - disabling it should be fine, until you decide to upgrade TinyMCEPlugin

Here is the setting you should use with the TinyMCEPlugin that's shipped with Foswiki 1.0.9:

  • Set TINYMCEPLUGIN_INIT = mode:"textareas",editor_selector : "foswikiWysiwygEdit",save_on_tinymce_forms: true,cleanup : true,theme : "advanced",convert_urls : true,relative_urls : false,remove_script_host : false,dialog_type: "modal",extended_valid_elements : "li[type]",forced_root_block : false,setupcontent_callback : FoswikiTiny.setUpContent,urlconverter_callback : "FoswikiTiny.convertLink",foswikipuburl_callback : "FoswikiTiny.convertPubURL",save_callback : "FoswikiTiny.saveCallback",debug:true,plugins : "table,searchreplace,autosave,safari,inlinepopups,fullscreen,foswikibuttons,foswikiimage",foswiki_secret_id : "WYSIWYG content - do not remove this comment, and never use this identical text in your topics",foswiki_vars : { PUBURLPATH : "/pub", PUBURL : "http://foswiki.org/pub", WEB : "Tasks", TOPIC : "Item9204", ATTACHURL : "http://foswiki.org/pub/Tasks/Item9204", ATTACHURLPATH : "/pub/Tasks/Item9204", VIEWSCRIPTURL : "http://foswiki.org", SCRIPTSUFFIX: "", SCRIPTURL : "http://foswiki.org/bin", SYSTEMWEB: "System" },theme_advanced_toolbar_align : "left",foswikibuttons_formats : [{ name: "Normal", el: "div", style: null },{ name: "Heading 1", el: "h1", style: null },{ name: "Heading 2", el: "h2", style: null },{ name: "Heading 3", el: "h3", style: null },{ name: "Heading 4", el: "h4", style: null },{ name: "Heading 5", el: "h5", style: null },{ name: "Heading 6", el: "h6", style: null },{ name: "VERBATIM", el: "pre", style: "TMLverbatim" },{ name: "LITERAL", el: "span", style: "WYSIWYG_LITERAL" },{ name: "Protect on save", el: null, style: "WYSIWYG_PROTECTED" },{ name: "Protect forever", el: null, style: "WYSIWYG_STICKY" }],paste_create_paragraphs : true,paste_create_linebreaks : false,paste_convert_middot_lists : true,paste_convert_headers_to_strong : false,paste_remove_spans: true,paste_remove_styles: true,paste_strip_class_attributes: "all",theme_advanced_buttons1 : "foswikiformat,separator,bold,italic,tt,colour,removeformat,separator,bullist,numlist,outdent,indent,blockquote,separator,link,unlink,anchor,separator,undo,redo,separator,search,replace",theme_advanced_buttons2: "tablecontrols,separator,attach,image,charmap,hr,separator,code,hide,fullscreen",theme_advanced_buttons3: "",theme_advanced_toolbar_location: "top",theme_advanced_resize_horizontal : false,theme_advanced_resizing : true,theme_advanced_path: false,theme_advanced_statusbar_location : "bottom",keep_styles : false,content_css : "/pub/System/TinyMCEPlugin/wysiwyg_src.css,/pub/System/SkinTemplates/base.css,/pub/System/PatternSkinThemeFatWilly/style.css,/pub/System/PatternSkinThemeFatWilly/colors.css"

-- PaulHarvey - 26 Jun 2010

Thanks! That seems to work better, no line break now and 'type' is still there. We'll have to see how loudly people scream about "unclean" pastes from Word now. smile

-- BryanThale - 26 Jun 2010

Personally I've been running the Foswiki 1.1 version of TinyMCEPlugin in production for a while now - overall it's an improved experience AFAICT.

If you find that pasting into WYSIWYG is less useful now with the paste plugin disabled - you may wish to instead play with the paste_* settings instead of disabling it totally (if you compare with TInyMCEPlugin you will notice that all I did was remove paste from the plugins list).

For example, I would start with paste_remove_styles: false

Closing

-- PaulHarvey - 26 Jun 2010

Changing to waiting for release so we can get the happy message that it is fixed in 1.1 in the release note.

-- KennethLavrsen - 26 Jun 2010

Is there any chance of a 1.0.x release of TinyMCEPlugin or is support for the new TinyMCE too tied to 1.1 for that to be practical?

-- BryanThale - 26 Jun 2010

That's what I meant earlier - I am running the latest 1.1 TinyMCEPlugin on my produciton 1.0.9 site.

You just need the latest JQueryPlugin, which happens to depend on ZonePlugin. So once you've got those upgraded/installed/enabled, you should be able to safely install the latest Testing release from Extensions.Testing.

The only reason I haven't pushed the 1.1 (trunk) TinyMCEPlugin on to 1.0.x is because it uses some jQuery now, and the necessary dependencies seem a bit much to impose on the unsuspecting 1.0.x upgrader.

-- PaulHarvey - 27 Jun 2010

I agree with Paul

We cannot push this on 1.0.9 upgraders

-- KennethLavrsen - 27 Jun 2010
 

ItemTemplate edit

Summary TinyMCE strips out 'type' arguments when pasting Foswiki macros from MS Word
ReportedBy BryanThale
Codebase 1.0.9
SVN Range 6076
AppliesTo Extension
Component TinyMCEPlugin
Priority Normal
CurrentState Closed
WaitingFor PaulHarvey
Checkins Foswikirev:7936
TargetRelease minor
ReleasedIn 1.1.0
Topic revision: r13 - 04 Oct 2010, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License