-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Paste from MS Word: Roman numbered lists not recognized #6620
Description
A roman numbered list copied from MS Word appears as a mixture of unordered and ordered lists.
Open word, create a numbered list with five items and set the styles to roman numbers. It should look like this in Word:
i. One
ii. Two
iii. Three
iv. Four
v. Five
Select the text and paste it to TinyMCE (with paste plugin and paste_convert_word_fake_lists enabled). You'll see this in TinyMCE:
1. One
2. Two
o Three
1. Four
2. Five
This would be the correct outuput:
1. One
2. Two
3. Three
4. Four
5. Five
The error is in lines 43 & 44 of WordFilter.ts. The code fails to detect roman numbers that use more than two letters, such as III, VII, VIII or XII.
tinymce/modules/tinymce/src/plugins/paste/main/ts/core/WordFilter.ts
Lines 36 to 44 in aca747c
| /** | |
| * Checks if the specified text starts with "1. " or "a. " etc. | |
| */ | |
| const isNumericList = (text) => { | |
| let found; | |
| const patterns = [ | |
| /^[IVXLMCD]{1,2}\.[ \u00a0]/, // Roman upper case | |
| /^[ivxlmcd]{1,2}\.[ \u00a0]/, // Roman lower case |
I'll submit a pull request to fix the issue. The bug must be old one, as it was previously reported in May 2016 as #2933.