Skip to content

Pasting from Word: List items starting with single word followed by a dot, will remove that word #2810

@Cordemans

Description

@Cordemans

Hi,

List items starting with a single word followed by a dot are removed because they are mistakenly being seen as part of the list.
Best to describe it with an example.

From Word:

  • foo. bar
  • foo bar. baz

Result in TinyMCE:

  • bar
  • foo bar. baz

I traced it back to WordFilter.js on (currently) line 184:
trimListStart(paragraphNode, /^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/);

The \w+\. part of the Regex is the cause of this removal.
I can only assume that this is needed for ordered lists starting with alpha characters (a. b. c.)

It is reproducible with the following Word document containing a small and simple list:
simplelist.docx

On pasting this content to tinymce, the "foo." part of the first list gets removed.
https://www.tinymce.com/docs/demo/basic-example/

Tested it with Word 2008 and 2011 (mac)
Latest TinyMCE (version 4.3.8)

Let me know if you need more info.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions