瀏覽代碼

Merge pull request #8390 from ckeditor/i/8080

Feature (paste-from-office): Support for preventing the list styles while pasting from Word. Closes #8080.
Maciej 5 年之前
父節點
當前提交
2c03820644
共有 31 個文件被更改,包括 394 次插入139 次删除
  1. 96 7
      packages/ckeditor5-paste-from-office/src/filters/list.js
  2. 2 2
      packages/ckeditor5-paste-from-office/tests/_data/list/heading1/model.word2016.html
  3. 2 2
      packages/ckeditor5-paste-from-office/tests/_data/list/heading3-styled/model.word2016.html
  4. 1 1
      packages/ckeditor5-paste-from-office/tests/_data/list/heading3-styled/normalized.safari.word2016.html
  5. 1 1
      packages/ckeditor5-paste-from-office/tests/_data/list/heading3-styled/normalized.word2016.html
  6. 1 1
      packages/ckeditor5-paste-from-office/tests/_data/list/heading7/model.word2016.html
  7. 12 12
      packages/ckeditor5-paste-from-office/tests/_data/list/many-one-item/model.word2016.html
  8. 8 8
      packages/ckeditor5-paste-from-office/tests/_data/list/many-one-item/normalized.safari.word2016.html
  9. 8 8
      packages/ckeditor5-paste-from-office/tests/_data/list/many-one-item/normalized.word2016.html
  10. 4 4
      packages/ckeditor5-paste-from-office/tests/_data/list/multiple-combined/model.word2016.html
  11. 3 3
      packages/ckeditor5-paste-from-office/tests/_data/list/multiple/model.word2016.html
  12. 1 1
      packages/ckeditor5-paste-from-office/tests/_data/list/multiple/normalized.safari.word2016.html
  13. 1 1
      packages/ckeditor5-paste-from-office/tests/_data/list/multiple/normalized.word2016.html
  14. 6 6
      packages/ckeditor5-paste-from-office/tests/_data/list/nested-mixed/model.word2016.html
  15. 2 2
      packages/ckeditor5-paste-from-office/tests/_data/list/nested-mixed/normalized.word2016.html
  16. 9 9
      packages/ckeditor5-paste-from-office/tests/_data/list/nested-multiple/model.word2016.html
  17. 6 6
      packages/ckeditor5-paste-from-office/tests/_data/list/nested-multiple/normalized.safari.word2016.html
  18. 5 5
      packages/ckeditor5-paste-from-office/tests/_data/list/nested-multiple/normalized.word2016.html
  19. 7 7
      packages/ckeditor5-paste-from-office/tests/_data/list/nested/model.word2016.html
  20. 2 2
      packages/ckeditor5-paste-from-office/tests/_data/list/nested/normalized.word2016.html
  21. 12 12
      packages/ckeditor5-paste-from-office/tests/_data/list/resume-template/model.safari.word2016.html
  22. 12 12
      packages/ckeditor5-paste-from-office/tests/_data/list/resume-template/model.word2016.html
  23. 8 8
      packages/ckeditor5-paste-from-office/tests/_data/list/resume-template/normalized.safari.word2016.html
  24. 8 8
      packages/ckeditor5-paste-from-office/tests/_data/list/resume-template/normalized.word2016.html
  25. 2 2
      packages/ckeditor5-paste-from-office/tests/_data/list/simple/model.word2016.html
  26. 3 3
      packages/ckeditor5-paste-from-office/tests/_data/list/styled/model.safari.word2016.html
  27. 3 3
      packages/ckeditor5-paste-from-office/tests/_data/list/styled/model.word2016.html
  28. 1 1
      packages/ckeditor5-paste-from-office/tests/_data/list/styled/normalized.safari.word2016.html
  29. 1 1
      packages/ckeditor5-paste-from-office/tests/_data/list/styled/normalized.word2016.html
  30. 2 1
      packages/ckeditor5-paste-from-office/tests/data/integration.js
  31. 165 0
      packages/ckeditor5-paste-from-office/tests/filters/list.js

+ 96 - 7
packages/ckeditor5-paste-from-office/src/filters/list.js

@@ -56,13 +56,11 @@ export function transformListItemLikeElementsIntoLists( documentFragment, styles
 				const lastListItemChild = lastListItem.getChild( lastListItem.childCount - 1 );
 
 				currentList = insertNewEmptyList( listStyle, lastListItemChild, writer );
-
 				currentIndentation += 1;
 			} else if ( itemLikeElement.indent < currentIndentation ) {
 				const differentIndentation = currentIndentation - itemLikeElement.indent;
 
 				currentList = findParentListAtLevel( currentList, differentIndentation );
-
 				currentIndentation = parseInt( itemLikeElement.indent );
 			}
 
@@ -158,9 +156,9 @@ function findAllItemLikeElements( documentFragment, writer ) {
 // @param {String} stylesString CSS stylesheet.
 // @returns {Object} result
 // @returns {String} result.type List type, could be `ul` or `ol`.
-// @returns {String} result.style List style, for example: `decimal`, `lower-roman`, etc. It is extracted
-// directly from Word stylesheet without further processing and may be not compatible
-// with CSS `list-style-type` property accepted values.
+// @returns {String|null} result.style List style, for example: `decimal`, `lower-roman`, etc. It is extracted
+// directly from Word stylesheet and adjusted to represent proper values for the CSS `list-style-type` property.
+// If it cannot be adjusted, the `null` value is returned.
 function detectListStyle( listLikeItem, stylesString ) {
 	const listStyleRegexp = new RegExp( `@list l${ listLikeItem.id }:level${ listLikeItem.indent }\\s*({[^}]*)`, 'gi' );
 	const listStyleTypeRegex = /mso-level-number-format:([^;]*);/gi;
@@ -168,20 +166,105 @@ function detectListStyle( listLikeItem, stylesString ) {
 	const listStyleMatch = listStyleRegexp.exec( stylesString );
 
 	let listStyleType = 'decimal'; // Decimal is default one.
+	let type = 'ol'; // <ol> is default list.
+
 	if ( listStyleMatch && listStyleMatch[ 1 ] ) {
 		const listStyleTypeMatch = listStyleTypeRegex.exec( listStyleMatch[ 1 ] );
 
 		if ( listStyleTypeMatch && listStyleTypeMatch[ 1 ] ) {
 			listStyleType = listStyleTypeMatch[ 1 ].trim();
+			type = listStyleType !== 'bullet' && listStyleType !== 'image' ? 'ol' : 'ul';
+		}
+
+		// Styles for the numbered lists are always defined in Word CSS stylesheet.
+		// Unordered lists MAY contain a value for the Word CSS definition `mso-level-text` but sometimes
+		// the tag is missing. And because of that, we cannot depend on that. We need to predict the list style value based on
+		// the list style marker element.
+		if ( listStyleType === 'bullet' ) {
+			const bulletedStyle = findBulletedListStyle( listLikeItem.element );
+
+			if ( bulletedStyle ) {
+				listStyleType = bulletedStyle;
+			}
 		}
 	}
 
 	return {
-		type: listStyleType !== 'bullet' && listStyleType !== 'image' ? 'ol' : 'ul',
-		style: listStyleType
+		type,
+		style: mapListStyleDefinition( listStyleType )
 	};
 }
 
+// Tries extract the `list-style-type` value based on the marker element for bulleted list.
+//
+// @param {module:engine/view/element~Element} element
+// @returns {module:engine/view/element~Element|null}
+function findBulletedListStyle( element ) {
+	const listMarkerElement = findListMarkerNode( element );
+
+	if ( !listMarkerElement ) {
+		return null;
+	}
+
+	const listMarker = listMarkerElement._data;
+
+	if ( listMarker === 'o' ) {
+		return 'circle';
+	} else if ( listMarker === '·' ) {
+		return 'disc';
+	}
+	// Word returns '§' instead of '■' for the square list style.
+	else if ( listMarker === '§' ) {
+		return 'square';
+	}
+
+	return null;
+}
+
+// Tries to find a text node that represents the marker element (list-style-type).
+//
+// @param {module:engine/view/element~Element} element
+// @returns {module:engine/view/text~Text|null}
+function findListMarkerNode( element ) {
+	// If the first child is a text node, it is a value for the element.
+	if ( element.getChild( 0 ).is( '$text' ) ) {
+		return null;
+	}
+
+	const textNodeOrElement = element.getChild( 0 ).getChild( 0 );
+
+	if ( textNodeOrElement.is( '$text' ) ) {
+		return textNodeOrElement;
+	}
+
+	return textNodeOrElement.getChild( 0 );
+}
+
+// Parses the `list-style-type` value extracted directly from the Word CSS stylesheet and returns proper CSS definition.
+//
+// @param {String|null} value
+// @returns {String|null}
+function mapListStyleDefinition( value ) {
+	switch ( value ) {
+		case 'arabic-leading-zero':
+			return 'decimal-leading-zero';
+		case 'alpha-upper':
+			return 'upper-alpha';
+		case 'alpha-lower':
+			return 'lower-alpha';
+		case 'roman-upper':
+			return 'upper-roman';
+		case 'roman-lower':
+			return 'lower-roman';
+		case 'circle':
+		case 'disc':
+		case 'square':
+			return value;
+		default:
+			return null;
+	}
+}
+
 // Creates empty list of a given type and inserts it after a specified element.
 //
 // @param {Object} listStyle List style object which determines the type of newly created list.
@@ -197,6 +280,12 @@ function insertNewEmptyList( listStyle, element, writer ) {
 
 	writer.insertChild( position, list, parent );
 
+	// We do not support modifying the marker for particular list item.
+	// Set the value for the `list-style-type` property directly to the list container.
+	if ( listStyle.style ) {
+		writer.setStyle( 'list-style-type', listStyle.style, list );
+	}
+
 	return list;
 }
 

+ 2 - 2
packages/ckeditor5-paste-from-office/tests/_data/list/heading1/model.word2016.html

@@ -1,2 +1,2 @@
-<listItem listIndent="0" listType="numbered">H1 1</listItem>
-<listItem listIndent="0" listType="numbered">H1 2</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">H1 1</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">H1 2</listItem>

+ 2 - 2
packages/ckeditor5-paste-from-office/tests/_data/list/heading3-styled/model.word2016.html

@@ -1,5 +1,5 @@
-<listItem listIndent="0" listType="bulleted">H<$text bold="true">2 1</$text></listItem>
-<listItem listIndent="0" listType="bulleted">
+<listItem listIndent="0" listStyle="disc" listType="bulleted">H<$text bold="true">2 1</$text></listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">
 	<$text italic="true" underline="true">H</$text>
 	<$text underline="true">2</$text> 2
 </listItem>

+ 1 - 1
packages/ckeditor5-paste-from-office/tests/_data/list/heading3-styled/normalized.safari.word2016.html

@@ -1,4 +1,4 @@
-<ul>
+<ul style="list-style-type:disc">
 	<li style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1">
 		<!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
 	Symbol;mso-ansi-language:PL"></span><!--[endif]-->

+ 1 - 1
packages/ckeditor5-paste-from-office/tests/_data/list/heading3-styled/normalized.word2016.html

@@ -1,4 +1,4 @@
-<ul>
+<ul style="list-style-type:disc">
 	<li style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'>
 		<![if !supportLists]>
 		<span lang=PL style='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language:PL'></span>

+ 1 - 1
packages/ckeditor5-paste-from-office/tests/_data/list/heading7/model.word2016.html

@@ -1 +1 @@
-<listItem listIndent="0" listType="numbered">H 7</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">H 7</listItem>

+ 12 - 12
packages/ckeditor5-paste-from-office/tests/_data/list/many-one-item/model.word2016.html

@@ -1,21 +1,21 @@
-<listItem listIndent="0" listType="numbered">A</listItem>
-<listItem listIndent="0" listType="numbered">B</listItem>
-<listItem listIndent="0" listType="numbered">C</listItem>
-<listItem listIndent="0" listType="numbered">D</listItem>
-<listItem listIndent="0" listType="numbered">E</listItem>
-<listItem listIndent="0" listType="numbered">F</listItem>
-<listItem listIndent="0" listType="numbered">G</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">A</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">B</listItem>
+<listItem listIndent="0" listStyle="upper-roman" listType="numbered">C</listItem>
+<listItem listIndent="0" listStyle="upper-alpha" listType="numbered">D</listItem>
+<listItem listIndent="0" listStyle="lower-alpha" listType="numbered">E</listItem>
+<listItem listIndent="0" listStyle="lower-alpha" listType="numbered">F</listItem>
+<listItem listIndent="0" listStyle="lower-roman" listType="numbered">G</listItem>
 
 <paragraph></paragraph>
 
-<listItem listIndent="0" listType="bulleted">H</listItem>
-<listItem listIndent="0" listType="bulleted">I</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">H</listItem>
+<listItem listIndent="0" listStyle="circle" listType="bulleted">I</listItem>
 
 <paragraph></paragraph>
 
-<listItem listIndent="0" listType="bulleted">J</listItem>
-<listItem listIndent="0" listType="bulleted">k</listItem>
+<listItem listIndent="0" listStyle="square" listType="bulleted">J</listItem>
+<listItem listIndent="0" listStyle="default" listType="bulleted">k</listItem>
 
 <paragraph></paragraph>
 
-<listItem listIndent="0" listType="numbered">h1</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">h1</listItem>

文件差異過大導致無法顯示
+ 8 - 8
packages/ckeditor5-paste-from-office/tests/_data/list/many-one-item/normalized.safari.word2016.html


+ 8 - 8
packages/ckeditor5-paste-from-office/tests/_data/list/many-one-item/normalized.word2016.html

@@ -16,7 +16,7 @@
 	</li>
 </ol>
 
-<ol>
+<ol style="list-style-type:upper-roman">
 	<li class=MsoListParagraphCxSpMiddle style='text-indent:-36.0pt;mso-text-indent-alt:-18.0pt;mso-list:l7 level1 lfo3'>
 		<![if !supportLists]>
 		<span lang=PL style='mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-ansi-language:PL'></span>
@@ -25,7 +25,7 @@
 	</li>
 </ol>
 
-<ol>
+<ol style="list-style-type:upper-alpha">
 	<li class=MsoListParagraphCxSpMiddle style='text-indent:-18.0pt;mso-list:l10 level1 lfo4'>
 		<![if !supportLists]>
 		<span lang=PL style='mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-ansi-language:PL'></span>
@@ -34,7 +34,7 @@
 	</li>
 </ol>
 
-<ol>
+<ol style="list-style-type:lower-alpha">
 	<li class=MsoListParagraphCxSpMiddle style='text-indent:-18.0pt;mso-list:l9 level1 lfo5'>
 		<![if !supportLists]>
 		<span lang=PL style='mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-ansi-language:PL'></span>
@@ -43,7 +43,7 @@
 	</li>
 </ol>
 
-<ol>
+<ol style="list-style-type:lower-alpha">
 	<li class=MsoListParagraphCxSpMiddle style='text-indent:-18.0pt;mso-list:l4 level1 lfo6'>
 		<![if !supportLists]>
 		<span lang=PL style='mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-ansi-language:PL'></span>
@@ -52,7 +52,7 @@
 	</li>
 </ol>
 
-<ol>
+<ol style="list-style-type:lower-roman">
 	<li class=MsoListParagraphCxSpLast style='text-indent:-36.0pt;mso-text-indent-alt:-18.0pt;mso-list:l6 level1 lfo7'>
 		<![if !supportLists]>
 		<span lang=PL style='mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-ansi-language:PL'></span>
@@ -63,7 +63,7 @@
 
 <p class=MsoNormal><span lang=PL style='mso-ansi-language:PL'></span></p>
 
-<ul>
+<ul style="list-style-type:disc">
 	<li class=MsoListParagraphCxSpFirst style='text-indent:-18.0pt;mso-list:l1 level1 lfo8'>
 		<![if !supportLists]>
 		<span lang=PL style='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language:PL'></span>
@@ -72,7 +72,7 @@
 	</li>
 </ul>
 
-<ul>
+<ul style="list-style-type:circle">
 	<li class=MsoListParagraphCxSpLast style='text-indent:-18.0pt;mso-list:l3 level1 lfo9'>
 		<![if !supportLists]>
 		<span lang=PL style='font-family:"Courier New";mso-fareast-font-family:"Courier New";mso-ansi-language:PL'></span>
@@ -83,7 +83,7 @@
 
 <p class=MsoNormal><span lang=PL style='mso-ansi-language:PL'></span></p>
 
-<ul>
+<ul style="list-style-type:square">
 	<li class=MsoListParagraphCxSpFirst style='text-indent:-18.0pt;mso-list:l8 level1 lfo10'>
 		<![if !supportLists]>
 		<span lang=PL style='font-family:Wingdings;mso-fareast-font-family:Wingdings;mso-bidi-font-family:Wingdings;mso-ansi-language:PL'></span>

+ 4 - 4
packages/ckeditor5-paste-from-office/tests/_data/list/multiple-combined/model.word2016.html

@@ -1,4 +1,4 @@
-<listItem listIndent="0" listType="numbered">Item1</listItem>
-<listItem listIndent="0" listType="numbered">Item 2</listItem>
-<listItem listIndent="0" listType="numbered">Item 1</listItem>
-<listItem listIndent="0" listType="numbered">Item2</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">Item1</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">Item 2</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">Item 1</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">Item2</listItem>

+ 3 - 3
packages/ckeditor5-paste-from-office/tests/_data/list/multiple/model.word2016.html

@@ -1,6 +1,6 @@
-<listItem listIndent="0" listType="numbered">Item1</listItem>
-<listItem listIndent="0" listType="numbered">Item 2</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">Item1</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">Item 2</listItem>
 
 <paragraph>Some text</paragraph>
 
-<listItem listIndent="0" listType="bulleted">Bullet 1</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Bullet 1</listItem>

文件差異過大導致無法顯示
+ 1 - 1
packages/ckeditor5-paste-from-office/tests/_data/list/multiple/normalized.safari.word2016.html


+ 1 - 1
packages/ckeditor5-paste-from-office/tests/_data/list/multiple/normalized.word2016.html

@@ -16,7 +16,7 @@
 
 <p class=MsoNormal><span lang=PL style='mso-ansi-language:PL'>Some text<o:p></o:p></span></p>
 
-<ul>
+<ul style="list-style-type:disc">
 	<li class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo2'>
 		<![if !supportLists]>
 		<span lang=PL style='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language:PL'></span>

+ 6 - 6
packages/ckeditor5-paste-from-office/tests/_data/list/nested-mixed/model.word2016.html

@@ -1,6 +1,6 @@
-<listItem listIndent="0" listType="bulleted">A1</listItem>
-<listItem listIndent="1" listType="numbered">B2</listItem>
-<listItem listIndent="2" listType="numbered">C4</listItem>
-<listItem listIndent="2" listType="numbered">D3</listItem>
-<listItem listIndent="0" listType="bulleted">E1</listItem>
-<listItem listIndent="1" listType="numbered">F2</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">A1</listItem>
+<listItem listIndent="1" listStyle="default" listType="numbered">B2</listItem>
+<listItem listIndent="2" listStyle="disc" listType="numbered">C4</listItem>
+<listItem listIndent="2" listStyle="disc" listType="numbered">D3</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">E1</listItem>
+<listItem listIndent="1" listStyle="default" listType="numbered">F2</listItem>

+ 2 - 2
packages/ckeditor5-paste-from-office/tests/_data/list/nested-mixed/normalized.word2016.html

@@ -1,10 +1,10 @@
-<ul>
+<ul style="list-style-type:disc">
 	<li class="MsoListParagraphCxSpFirst" style="mso-list:l0 level1 lfo1;text-indent:-18.0pt">
 		<span style="font-family:Symbol;mso-bidi-font-family:Symbol;mso-fareast-font-family:Symbol"></span>A1<o:p></o:p>
 		<ol>
 			<li class="MsoListParagraphCxSpMiddle" style="margin-left:72.0pt;mso-add-space:auto;mso-list:l0 level2 lfo1;text-indent:-18.0pt">
 				<span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin"></span>B2<o:p></o:p>
-				<ol>
+				<ol style="list-style-type:disc">
 					
 					<li class="MsoListParagraphCxSpMiddle" style="margin-left:144.0pt;mso-add-space:auto;mso-list:l0 level4 lfo1;text-indent:-18.0pt">
 						<span style="font-family:Symbol;mso-bidi-font-family:Symbol;mso-fareast-font-family:Symbol"></span>C4<o:p></o:p>

+ 9 - 9
packages/ckeditor5-paste-from-office/tests/_data/list/nested-multiple/model.word2016.html

@@ -1,17 +1,17 @@
-<listItem listIndent="0" listType="bulleted">A1</listItem>
-<listItem listIndent="1" listType="numbered">B3</listItem>
-<listItem listIndent="1" listType="numbered">C2</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">A1</listItem>
+<listItem listIndent="1" listStyle="square" listType="numbered">B3</listItem>
+<listItem listIndent="1" listStyle="square" listType="numbered">C2</listItem>
 
 <paragraph></paragraph>
 <paragraph>Foo Bar...</paragraph>
 <paragraph></paragraph>
 
-<listItem listIndent="0" listType="numbered">A2</listItem>
-<listItem listIndent="0" listType="numbered">B1</listItem>
-<listItem listIndent="1" listType="numbered">C2</listItem>
+<listItem listIndent="0" listStyle="lower-alpha" listType="numbered">A2</listItem>
+<listItem listIndent="0" listStyle="lower-alpha" listType="numbered">B1</listItem>
+<listItem listIndent="1" listStyle="lower-alpha" listType="numbered">C2</listItem>
 
 <paragraph></paragraph>
 
-<listItem listIndent="0" listType="bulleted">A1</listItem>
-<listItem listIndent="1" listType="numbered">B2</listItem>
-<listItem listIndent="0" listType="bulleted">C1</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">A1</listItem>
+<listItem listIndent="1" listStyle="default" listType="numbered">B2</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">C1</listItem>

+ 6 - 6
packages/ckeditor5-paste-from-office/tests/_data/list/nested-multiple/normalized.safari.word2016.html

@@ -1,7 +1,7 @@
-<ul>
+<ul style="list-style-type:disc">
 	<li class="MsoListParagraphCxSpFirst" style="mso-list:l1 level1 lfo2;text-indent:-18.0pt">
 		<span style="font-family:Symbol;mso-bidi-font-family:Symbol;mso-fareast-font-family:Symbol"></span>A1<o:p></o:p>
-		<ol>
+		<ol style="list-style-type:square">
 			
           <li class="MsoListParagraphCxSpMiddle" style="margin-left:108.0pt;mso-add-space:auto;mso-list:l1 level3 lfo2;text-indent:-18.0pt">
             <span style="font-family:Wingdings;mso-bidi-font-family:Wingdings;mso-fareast-font-family:Wingdings"></span>B3<o:p></o:p>
@@ -18,14 +18,14 @@
 <p class="MsoNormal" style="-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;caret-color:rgb(0, 0, 0);color:rgb(0, 0, 0);font-family:Calibri, sans-serif;font-size:medium;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;margin:0cm 0cm 0.0001pt;orphans:auto;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;widows:auto;word-spacing:0px">Foo Bar...<o:p></o:p></p>
 <p class="MsoNormal" style="-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;caret-color:rgb(0, 0, 0);color:rgb(0, 0, 0);font-family:Calibri, sans-serif;font-size:medium;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;margin:0cm 0cm 0.0001pt;orphans:auto;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;widows:auto;word-spacing:0px"></p>
 
-<ol>
+<ol style="list-style-type:lower-alpha">
   <li class="MsoListParagraphCxSpFirst" style="margin-left:72.0pt;mso-add-space:auto;mso-list:l0 level2 lfo1;text-indent:-18.0pt">
     <span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin"></span>A2<o:p></o:p>
   </li>
 
     <li class="MsoListParagraphCxSpMiddle" style="mso-list:l0 level1 lfo1;text-indent:-18.0pt">
 		<span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin"></span>B1<o:p></o:p>
-		<ol>
+		<ol style="list-style-type:lower-alpha">
 			<li class="MsoListParagraphCxSpLast" style="margin-left:72.0pt;mso-add-space:auto;mso-list:l0 level2 lfo1;text-indent:-18.0pt">
 				<span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin"></span>C2<o:p></o:p>
 			</li>
@@ -35,7 +35,7 @@
 
 <p class="MsoNormal" style="-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;caret-color:rgb(0, 0, 0);color:rgb(0, 0, 0);font-family:Calibri, sans-serif;font-size:medium;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;margin:0cm 0cm 0.0001pt;orphans:auto;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;widows:auto;word-spacing:0px"></p>
 
-<ul>
+<ul style="list-style-type:disc">
 	<li class="MsoListParagraphCxSpFirst" style="mso-list:l1 level1 lfo2;text-indent:-18.0pt">
 		<span style="font-family:Symbol;mso-bidi-font-family:Symbol;mso-fareast-font-family:Symbol"></span>A1<o:p></o:p>
 		<ol>
@@ -48,4 +48,4 @@
 	<li class="MsoListParagraphCxSpLast" style="mso-list:l1 level1 lfo2;text-indent:-18.0pt">
 		<span style="font-family:Symbol;mso-bidi-font-family:Symbol;mso-fareast-font-family:Symbol"></span>C1<o:p></o:p>
 	</li>
-</ul>
+</ol>

+ 5 - 5
packages/ckeditor5-paste-from-office/tests/_data/list/nested-multiple/normalized.word2016.html

@@ -1,7 +1,7 @@
-<ul>
+<ul style="list-style-type:disc">
 	<li class="MsoListParagraphCxSpFirst" style="mso-list:l1 level1 lfo2;text-indent:-18.0pt">
 		<span style="font-family:Symbol;mso-bidi-font-family:Symbol;mso-fareast-font-family:Symbol"></span>A1<o:p></o:p>
-		<ol>
+		<ol style="list-style-type:square">
           <li class="MsoListParagraphCxSpMiddle" style="margin-left:108.0pt;mso-add-space:auto;mso-list:l1 level3 lfo2;text-indent:-18.0pt">
             <span style="font-family:Wingdings;mso-bidi-font-family:Wingdings;mso-fareast-font-family:Wingdings"></span>B3<o:p></o:p>
           </li>
@@ -17,14 +17,14 @@
 <p class="MsoNormal">Foo Bar...<o:p></o:p></p>
 <p class="MsoNormal"></p>
 
-<ol>
+<ol style="list-style-type:lower-alpha">
   <li class="MsoListParagraphCxSpFirst" style="margin-left:72.0pt;mso-add-space:auto;mso-list:l0 level2 lfo1;text-indent:-18.0pt">
     <span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin"></span>A2<o:p></o:p>
   </li>
 
     <li class="MsoListParagraphCxSpMiddle" style="mso-list:l0 level1 lfo1;text-indent:-18.0pt">
 		<span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin"></span>B1<o:p></o:p>
-		<ol>
+		<ol style="list-style-type:lower-alpha">
 			<li class="MsoListParagraphCxSpLast" style="margin-left:72.0pt;mso-add-space:auto;mso-list:l0 level2 lfo1;text-indent:-18.0pt">
 				<span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin"></span>C2<o:p></o:p>
 			</li>
@@ -34,7 +34,7 @@
 
 <p class="MsoNormal"></p>
 
-<ul>
+<ul style="list-style-type:disc">
 	<li class="MsoListParagraphCxSpFirst" style="mso-list:l1 level1 lfo2;text-indent:-18.0pt">
 		<span style="font-family:Symbol;mso-bidi-font-family:Symbol;mso-fareast-font-family:Symbol"></span>A1<o:p></o:p>
 		<ol>

+ 7 - 7
packages/ckeditor5-paste-from-office/tests/_data/list/nested/model.word2016.html

@@ -1,7 +1,7 @@
-<listItem listIndent="0" listType="numbered">A1</listItem>
-<listItem listIndent="0" listType="numbered">B1</listItem>
-<listItem listIndent="1" listType="numbered">C2</listItem>
-<listItem listIndent="2" listType="numbered">D4</listItem>
-<listItem listIndent="1" listType="numbered">E2</listItem>
-<listItem listIndent="2" listType="numbered">F3</listItem>
-<listItem listIndent="0" listType="numbered">G1</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">A1</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">B1</listItem>
+<listItem listIndent="1" listStyle="lower-alpha" listType="numbered">C2</listItem>
+<listItem listIndent="2" listStyle="default" listType="numbered">D4</listItem>
+<listItem listIndent="1" listStyle="lower-alpha" listType="numbered">E2</listItem>
+<listItem listIndent="2" listStyle="lower-roman" listType="numbered">F3</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">G1</listItem>

+ 2 - 2
packages/ckeditor5-paste-from-office/tests/_data/list/nested/normalized.word2016.html

@@ -5,7 +5,7 @@
 
 	<li class="MsoListParagraphCxSpMiddle" style="mso-list:l0 level1 lfo1;text-indent:-18.0pt">
 		<span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin"></span>B1<o:p></o:p>
-		<ol>
+		<ol style="list-style-type:lower-alpha">
 			<li class="MsoListParagraphCxSpMiddle" style="margin-left:72.0pt;mso-add-space:auto;mso-list:l0 level2 lfo1;text-indent:-18.0pt">
 				<span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin"></span>C2<o:p></o:p>
 				<ol>
@@ -17,7 +17,7 @@
 
 			<li class="MsoListParagraphCxSpMiddle" style="margin-left:72.0pt;mso-add-space:auto;mso-list:l0 level2 lfo1;text-indent:-18.0pt">
 				<span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin"></span>E2<o:p></o:p>
-				<ol>
+				<ol style="list-style-type:lower-roman">
 					<li class="MsoListParagraphCxSpMiddle" style="margin-left:108.0pt;mso-add-space:auto;mso-list:l0 level3 lfo1;mso-text-indent-alt:-9.0pt;text-indent:-108.0pt">
 						<span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin"></span>F3<o:p></o:p>
 					</li>

+ 12 - 12
packages/ckeditor5-paste-from-office/tests/_data/list/resume-template/model.safari.word2016.html

@@ -10,40 +10,40 @@
 
 <heading1>DEGREE | DATE EARNED | SCHOOL</heading1>
 
-<listItem listIndent="0" listType="bulleted">Major: Click here to enter text</listItem>
-<listItem listIndent="0" listType="bulleted">Minor: Click here to enter text</listItem>
-<listItem listIndent="0" listType="bulleted">Related coursework: Click here to enter text</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Major: Click here to enter text</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Minor: Click here to enter text</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Related coursework: Click here to enter text</listItem>
 
 <heading1>DEGREE | DATE EARNED | SCHOOL</heading1>
 
-<listItem listIndent="0" listType="bulleted">Major: Click here to enter text</listItem>
-<listItem listIndent="0" listType="bulleted">Minor: Click here to enter text</listItem>
-<listItem listIndent="0" listType="bulleted">Related coursework: Click here to enter text</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Major: Click here to enter text</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Minor: Click here to enter text</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Related coursework: Click here to enter text</listItem>
 
 <heading1>Skills & Abilities</heading1>
 
 <heading1>MANAGEMENT</heading1>
 
-<listItem listIndent="0" listType="bulleted">Think a document that looks this good has to be difficult to format? Think again! To easily apply any text formatting you see in this document with just a click, on the Home tab of the ribbon, check out Styles.</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Think a document that looks this good has to be difficult to format? Think again! To easily apply any text formatting you see in this document with just a click, on the Home tab of the ribbon, check out Styles.</listItem>
 
 <heading1>SALES</heading1>
 
-<listItem listIndent="0" listType="bulleted">Some of the sample text in this document indicates the name of the style applied, so that you can easily apply the same formatting again. For example, this is the List Bullet style.</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Some of the sample text in this document indicates the name of the style applied, so that you can easily apply the same formatting again. For example, this is the List Bullet style.</listItem>
 
 <heading1>COMMUNICATION</heading1>
 
-<listItem listIndent="0" listType="bulleted">You delivered that big presentation to rave reviews. Don’t be shy about it now! This is the place to show how well you work and play with others.</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">You delivered that big presentation to rave reviews. Don’t be shy about it now! This is the place to show how well you work and play with others.</listItem>
 
 <heading1>LEADERSHIP</heading1>
 
-<listItem listIndent="0" listType="bulleted">Are you president of your fraternity, head of the condo board, or a team lead for your favorite charity? You’re a natural leader—tell it like it is!</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Are you president of your fraternity, head of the condo board, or a team lead for your favorite charity? You’re a natural leader—tell it like it is!</listItem>
 
 <heading1>Experience</heading1>
 
 <heading1>JOB TITLE | COMPANY | DATES FROM - TO</heading1>
 
-<listItem listIndent="0" listType="bulleted">This is the place for a brief summary of your key responsibilities and most stellar accomplishments.</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">This is the place for a brief summary of your key responsibilities and most stellar accomplishments.</listItem>
 
 <heading1>JOB TITLE | COMPANY | DATES FROM - TO</heading1>
 
-<listItem listIndent="0" listType="bulleted">This is the place for a brief summary of your key responsibilities and most stellar accomplishments.</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">This is the place for a brief summary of your key responsibilities and most stellar accomplishments.</listItem>

+ 12 - 12
packages/ckeditor5-paste-from-office/tests/_data/list/resume-template/model.word2016.html

@@ -10,40 +10,40 @@
 
 <heading1>Degree | Date Earned | School</heading1>
 
-<listItem listIndent="0" listType="bulleted">Major: Click here to enter text</listItem>
-<listItem listIndent="0" listType="bulleted">Minor: Click here to enter text</listItem>
-<listItem listIndent="0" listType="bulleted">Related coursework: Click here to enter text</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Major: Click here to enter text</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Minor: Click here to enter text</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Related coursework: Click here to enter text</listItem>
 
 <heading1>Degree | Date Earned | School</heading1>
 
-<listItem listIndent="0" listType="bulleted">Major: Click here to enter text</listItem>
-<listItem listIndent="0" listType="bulleted">Minor: Click here to enter text</listItem>
-<listItem listIndent="0" listType="bulleted">Related coursework: Click here to enter text</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Major: Click here to enter text</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Minor: Click here to enter text</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Related coursework: Click here to enter text</listItem>
 
 <heading1>Skills & Abilities</heading1>
 
 <heading1>Management</heading1>
 
-<listItem listIndent="0" listType="bulleted">Think a document that looks this good has to be difficult to format? Think again! To easily apply any text formatting you see in this document with just a click, on the Home tab of the ribbon, check out Styles.</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Think a document that looks this good has to be difficult to format? Think again! To easily apply any text formatting you see in this document with just a click, on the Home tab of the ribbon, check out Styles.</listItem>
 
 <heading1>Sales</heading1>
 
-<listItem listIndent="0" listType="bulleted">Some of the sample text in this document indicates the name of the style applied, so that you can easily apply the same formatting again. For example, this is the List Bullet style.</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Some of the sample text in this document indicates the name of the style applied, so that you can easily apply the same formatting again. For example, this is the List Bullet style.</listItem>
 
 <heading1>Communication</heading1>
 
-<listItem listIndent="0" listType="bulleted">You delivered that big presentation to rave reviews. Don’t be shy about it now! This is the place to show how well you work and play with others.</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">You delivered that big presentation to rave reviews. Don’t be shy about it now! This is the place to show how well you work and play with others.</listItem>
 
 <heading1>Leadership</heading1>
 
-<listItem listIndent="0" listType="bulleted">Are you president of your fraternity, head of the condo board, or a team lead for your favorite charity? You’re a natural leader—tell it like it is!</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">Are you president of your fraternity, head of the condo board, or a team lead for your favorite charity? You’re a natural leader—tell it like it is!</listItem>
 
 <heading1>Experience</heading1>
 
 <heading1>Job Title | Company | Dates From - To</heading1>
 
-<listItem listIndent="0" listType="bulleted">This is the place for a brief summary of your key responsibilities and most stellar accomplishments.</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">This is the place for a brief summary of your key responsibilities and most stellar accomplishments.</listItem>
 
 <heading1>Job Title | Company | Dates From - To</heading1>
 
-<listItem listIndent="0" listType="bulleted">This is the place for a brief summary of your key responsibilities and most stellar accomplishments.</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">This is the place for a brief summary of your key responsibilities and most stellar accomplishments.</listItem>

文件差異過大導致無法顯示
+ 8 - 8
packages/ckeditor5-paste-from-office/tests/_data/list/resume-template/normalized.safari.word2016.html


+ 8 - 8
packages/ckeditor5-paste-from-office/tests/_data/list/resume-template/normalized.word2016.html

@@ -42,7 +42,7 @@
 	</span>
 </h2>
 
-<ul>
+<ul style="list-style-type:disc">
 	<li class="MsoListBulletCxSpFirst" style="mso-list:l0 level1 lfo1">
 		<span lang="EN-US" style="mso-ascii-font-family:Cambria;mso-bidi-font-family:Cambria;mso-fareast-font-family:Cambria;mso-hansi-font-family:Cambria"></span>
 		<span lang="EN-US">Major: <w:sdt docpart="11254AB6F6AF3048B0FB77B19E14A276" id="1821224400" sdttag="Major:" showingplchdr="t" temporary="t" text="t" title="Major:">Click here to enter text</w:sdt><o:p></o:p></span>
@@ -65,7 +65,7 @@
 	</span>
 </h2>
 
-<ul>
+<ul style="list-style-type:disc">
 	<li class="MsoListBulletCxSpFirst" style="mso-list:l0 level1 lfo1">
 		<span lang="EN-US" style="mso-ascii-font-family:Cambria;mso-bidi-font-family:Cambria;mso-fareast-font-family:Cambria;mso-hansi-font-family:Cambria"></span>
 		<span lang="EN-US">Major: <w:sdt docpart="2D9029A2B401CC42944B7EB502F83824" id="1046181329" sdttag="Major:" showingplchdr="t" temporary="t" text="t" title="Major:">Click here to enter text</w:sdt><o:p></o:p></span>
@@ -95,7 +95,7 @@
 </w:sdt>
 
 <w:sdt docpart="C51B29163715CD4F99529A18C891B99B" id="-1177730712" sdttag="Management Skills:" showingplchdr="t" temporary="t" title="Management Skills:">
-	<ul>
+	<ul style="list-style-type:disc">
 		<li class="MsoListBullet" style="mso-list:l0 level1 lfo1">
 			<span lang="EN-US" style="mso-ascii-font-family:Cambria;mso-bidi-font-family:Cambria;mso-fareast-font-family:Cambria;mso-hansi-font-family:Cambria"></span>
 			<span lang="EN-US">Think a document that looks this good has to be difficult to format? Think again! To easily apply any text formatting you see in this document with just a click, on the Home tab of the ribbon, check out Styles.<o:p></o:p><w:sdtpr></w:sdtpr></span>
@@ -110,7 +110,7 @@
 </w:sdt>
 
 <w:sdt docpart="92F72DE9A594584B9C488FED96B568B4" id="1544489962" sdttag="Sales Skills:" showingplchdr="t" temporary="t" title="Sales Skills:">
-	<ul>
+	<ul style="list-style-type:disc">
 		<li class="MsoListBullet" style="mso-list:l0 level1 lfo1">
 			<span lang="EN-US" style="mso-ascii-font-family:Cambria;mso-bidi-font-family:Cambria;mso-fareast-font-family:Cambria;mso-hansi-font-family:Cambria"></span>
 			<span lang="EN-US">Some of the sample text in this document indicates the name of the style applied, so that you can easily apply the same formatting again. For example, this is the List Bullet style.<o:p></o:p><w:sdtpr></w:sdtpr></span>
@@ -124,7 +124,7 @@
 	</h2>
 </w:sdt>
 
-<ul>
+<ul style="list-style-type:disc">
 	<li class="MsoListBullet" style="mso-list:l0 level1 lfo1">
 		<span lang="EN-US" style="mso-ascii-font-family:Cambria;mso-bidi-font-family:Cambria;mso-fareast-font-family:Cambria;mso-hansi-font-family:Cambria"></span>
 		<span lang="EN-US"><w:sdt docpart="1018054470CB4B4B93F5C30010DA2E3A" id="-1819335404" sdttag="Communication Skills:" showingplchdr="t" temporary="t" title="Communication Skills:">You delivered that big presentation to rave reviews. Don’t be shy about it now! This is the place to show how well you work and play with others.</w:sdt><o:p></o:p></span>
@@ -137,7 +137,7 @@
 	</h2>
 </w:sdt>
 
-<ul>
+<ul style="list-style-type:disc">
 	<li class="MsoListBullet" style="mso-list:l0 level1 lfo1">
 		<span lang="EN-US" style="mso-ascii-font-family:Cambria;mso-bidi-font-family:Cambria;mso-fareast-font-family:Cambria;mso-hansi-font-family:Cambria"></span>
 		<span lang="EN-US"><w:sdt docpart="D969CD1F1B5AC04493396C70BC53F75B" id="-1072199855" sdttag="Leadership Skills:" showingplchdr="t" temporary="t" title="Leadership Skills:">Are you president of your fraternity, head of the condo board, or a team lead for your favorite charity? You’re a natural leader—tell it like it is!</w:sdt><o:p></o:p></span>
@@ -157,7 +157,7 @@
 </h2>
 
 <w:sdt docpart="6484D2D9F5586D4E94F9BC3CAEDFDE20" id="-513455036" sdttag="Key responsibilities for Job Title 1:" showingplchdr="t" temporary="t" title="Key responsibilities for Job Title 1:">
-	<ul>
+	<ul style="list-style-type:disc">
 		<li class="MsoListBullet" style="mso-list:l0 level1 lfo1">
 			<span lang="EN-US" style="mso-ascii-font-family:Cambria;mso-bidi-font-family:Cambria;mso-fareast-font-family:Cambria;mso-hansi-font-family:Cambria"></span>
 			<span lang="EN-US">This is the place for a brief summary of your key responsibilities and most stellar accomplishments.<o:p></o:p><w:sdtpr></w:sdtpr></span>
@@ -172,7 +172,7 @@
 </h2>
 
 <w:sdt docpart="290D27AE8D9A964ABE103E88C285CB84" id="2140524828" sdttag="Key responsibilities for Job Title 2:" showingplchdr="t" temporary="t" title="Key responsibilities for Job Title 2:">
-	<ul>
+	<ul style="list-style-type:disc">
 		<li class="MsoListBullet" style="mso-list:l0 level1 lfo1">
 			<span lang="EN-US" style="mso-ascii-font-family:Cambria;mso-bidi-font-family:Cambria;mso-fareast-font-family:Cambria;mso-hansi-font-family:Cambria"></span>
 			<span lang="EN-US">This is the place for a brief summary of your key responsibilities and most stellar accomplishments.<o:p></o:p><w:sdtpr></w:sdtpr></span>

+ 2 - 2
packages/ckeditor5-paste-from-office/tests/_data/list/simple/model.word2016.html

@@ -1,2 +1,2 @@
-<listItem listIndent="0" listType="numbered">Item1</listItem>
-<listItem listIndent="0" listType="numbered">Item 2</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">Item1</listItem>
+<listItem listIndent="0" listStyle="default" listType="numbered">Item 2</listItem>

+ 3 - 3
packages/ckeditor5-paste-from-office/tests/_data/list/styled/model.safari.word2016.html

@@ -1,8 +1,8 @@
 <paragraph>List:</paragraph>
 
-<listItem listIndent="0" listType="bulleted">B<$text bold="true">old</$text></listItem>
-<listItem listIndent="0" listType="bulleted"><$text linkHref="https://cksource.com/" underline="true">Lin</$text>k</listItem>
-<listItem listIndent="0" listType="bulleted">
+<listItem listIndent="0" listStyle="disc" listType="bulleted">B<$text bold="true">old</$text></listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted"><$text linkHref="https://cksource.com/" underline="true">Lin</$text>k</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">
 	<$text italic="true">M</$text><$text bold="true" italic="true">ul</$text>
 <$text bold="true" italic="true" underline="true">tip</$text>
 <$text italic="true" underline="true">le</$text>

+ 3 - 3
packages/ckeditor5-paste-from-office/tests/_data/list/styled/model.word2016.html

@@ -1,8 +1,8 @@
 <paragraph>List:</paragraph>
 
-<listItem listIndent="0" listType="bulleted">B<$text bold="true">old</$text></listItem>
-<listItem listIndent="0" listType="bulleted"><$text linkHref="https://cksource.com">Lin</$text>k</listItem>
-<listItem listIndent="0" listType="bulleted">
+<listItem listIndent="0" listStyle="disc" listType="bulleted">B<$text bold="true">old</$text></listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted"><$text linkHref="https://cksource.com">Lin</$text>k</listItem>
+<listItem listIndent="0" listStyle="disc" listType="bulleted">
 	<$text italic="true">M</$text><$text bold="true" italic="true">ul</$text>
 	<$text bold="true" italic="true" underline="true">tip</$text>
 	<$text italic="true" underline="true">le</$text>

+ 1 - 1
packages/ckeditor5-paste-from-office/tests/_data/list/styled/normalized.safari.word2016.html

@@ -2,7 +2,7 @@
 	<span>List:<o:p></o:p></span>
 </p>
 
-<ul>
+<ul style="list-style-type:disc">
 	<li class="MsoListParagraphCxSpFirst" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1">
 		<!--[if !supportLists]--><span style="font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:
 	Symbol;mso-ansi-language:PL"></span><!--[endif]-->

+ 1 - 1
packages/ckeditor5-paste-from-office/tests/_data/list/styled/normalized.word2016.html

@@ -2,7 +2,7 @@
 	<span lang=PL style='mso-ansi-language:PL'>List:<o:p></o:p></span>
 </p>
 
-<ul>
+<ul style="list-style-type:disc">
 	<li class=MsoListParagraphCxSpFirst style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'>
 		<![if !supportLists]>
 		<span lang=PL style='font-family:Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language:PL'></span>

+ 2 - 1
packages/ckeditor5-paste-from-office/tests/data/integration.js

@@ -13,6 +13,7 @@ import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
 import Link from '@ckeditor/ckeditor5-link/src/link';
 import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough';
 import List from '@ckeditor/ckeditor5-list/src/list';
+import ListStyle from '@ckeditor/ckeditor5-list/src/liststyle';
 import Image from '@ckeditor/ckeditor5-image/src/image';
 import Table from '@ckeditor/ckeditor5-table/src/table';
 import TableProperties from '@ckeditor/ckeditor5-table/src/tableproperties';
@@ -71,7 +72,7 @@ describe( 'PasteFromOffice - integration', () => {
 		type: 'integration',
 		browsers,
 		editorConfig: {
-			plugins: [ Clipboard, Paragraph, Heading, Bold, Italic, Underline, Link, List, PasteFromOffice ]
+			plugins: [ Clipboard, Paragraph, Heading, Bold, Italic, Underline, Link, List, ListStyle, PasteFromOffice ]
 		},
 		skip: {
 			safari: [ 'heading3Styled' ] // Skip due to spacing issue (#13).

+ 165 - 0
packages/ckeditor5-paste-from-office/tests/filters/list.js

@@ -182,6 +182,171 @@ describe( 'PasteFromOffice - filters', () => {
 						'</ol>' );
 				} );
 			} );
+
+			describe( 'list styles', () => {
+				const level1 = 'style="mso-list:l0 level1 lfo0"';
+
+				describe( 'ordered list', () => {
+					it( 'converts "roman-lower" style to proper CSS attribute', () => {
+						const styles = '@list l0:level1\n' +
+							'{mso-level-number-format:roman-lower;}';
+
+						const html = `<p ${ level1 }>Foo</p>`;
+						const view = htmlDataProcessor.toView( html );
+
+						transformListItemLikeElementsIntoLists( view, styles );
+
+						expect( stringify( view ) ).to.equal(
+							`<ol style="list-style-type:lower-roman"><li ${ level1 }>Foo</li></ol>`
+						);
+					} );
+
+					it( 'converts "alpha-upper" style to proper CSS attribute', () => {
+						const styles = '@list l0:level1\n' +
+							'{mso-level-number-format:alpha-upper;}';
+
+						const html = `<p ${ level1 }>Foo</p>`;
+						const view = htmlDataProcessor.toView( html );
+
+						transformListItemLikeElementsIntoLists( view, styles );
+
+						expect( stringify( view ) ).to.equal(
+							`<ol style="list-style-type:upper-alpha"><li ${ level1 }>Foo</li></ol>`
+						);
+					} );
+
+					it( 'converts "alpha-lower" style to proper CSS attribute', () => {
+						const styles = '@list l0:level1\n' +
+							'{mso-level-number-format:alpha-lower;}';
+
+						const html = `<p ${ level1 }>Foo</p>`;
+						const view = htmlDataProcessor.toView( html );
+
+						transformListItemLikeElementsIntoLists( view, styles );
+
+						expect( stringify( view ) ).to.equal(
+							`<ol style="list-style-type:lower-alpha"><li ${ level1 }>Foo</li></ol>`
+						);
+					} );
+					it( 'converts "roman-upper" style to proper CSS attribute', () => {
+						const styles = '@list l0:level1\n' +
+							'{mso-level-number-format:roman-upper;}';
+
+						const html = `<p ${ level1 }>Foo</p>`;
+						const view = htmlDataProcessor.toView( html );
+
+						transformListItemLikeElementsIntoLists( view, styles );
+
+						expect( stringify( view ) ).to.equal(
+							`<ol style="list-style-type:upper-roman"><li ${ level1 }>Foo</li></ol>`
+						);
+					} );
+
+					it( 'converts "arabic-leading-zero" style to proper CSS attribute', () => {
+						const styles = '@list l0:level1\n' +
+							'{mso-level-number-format:arabic-leading-zero;}';
+
+						const html = `<p ${ level1 }>Foo</p>`;
+						const view = htmlDataProcessor.toView( html );
+
+						transformListItemLikeElementsIntoLists( view, styles );
+
+						expect( stringify( view ) ).to.equal(
+							`<ol style="list-style-type:decimal-leading-zero"><li ${ level1 }>Foo</li></ol>`
+						);
+					} );
+				} );
+
+				describe( 'unordered list', () => {
+					it( 'converts "circle" style to proper CSS attribute', () => {
+						const styles = '@list l0:level1\n' +
+							'{mso-level-number-format:bullet;}';
+
+						const html = `<p class=MsoListBulletCxSpFirst ${ level1 }>` +
+							'<span lang=\'EN-US\'><span style=\'mso-list:Ignore\'>o<span>&nbsp;&nbsp;</span></span></span></span>' +
+							'<span>Foo</span>' +
+							'</p>';
+
+						const view = htmlDataProcessor.toView( html );
+
+						transformListItemLikeElementsIntoLists( view, styles );
+
+						expect( stringify( view ) ).to.equal(
+							'<ul style="list-style-type:circle">' +
+								`<li class="MsoListBulletCxSpFirst" ${ level1 }>` +
+									'<span lang="EN-US"></span><span>Foo</span>' +
+								'</li>' +
+							'</ul>'
+						);
+					} );
+
+					it( 'converts "disc" style to proper CSS attribute', () => {
+						const styles = '@list l0:level1\n' +
+							'{mso-level-number-format:bullet;}';
+
+						const html = `<p class=MsoListBulletCxSpFirst ${ level1 }>` +
+							'<span lang=\'EN-US\'><span style=\'mso-list:Ignore\'>·<span>&nbsp;&nbsp;</span></span></span></span>' +
+							'<span>Foo</span>' +
+							'</p>';
+
+						const view = htmlDataProcessor.toView( html );
+
+						transformListItemLikeElementsIntoLists( view, styles );
+
+						expect( stringify( view ) ).to.equal(
+							'<ul style="list-style-type:disc">' +
+							`<li class="MsoListBulletCxSpFirst" ${ level1 }>` +
+							'<span lang="EN-US"></span><span>Foo</span>' +
+							'</li>' +
+							'</ul>'
+						);
+					} );
+
+					it( 'converts "square" style to proper CSS attribute', () => {
+						const styles = '@list l0:level1\n' +
+							'{mso-level-number-format:bullet;}';
+
+						const html = `<p class=MsoListBulletCxSpFirst ${ level1 }>` +
+							'<span lang=\'EN-US\'><span style=\'mso-list:Ignore\'>§<span>&nbsp;&nbsp;</span></span></span></span>' +
+							'<span>Foo</span>' +
+							'</p>';
+
+						const view = htmlDataProcessor.toView( html );
+
+						transformListItemLikeElementsIntoLists( view, styles );
+
+						expect( stringify( view ) ).to.equal(
+							'<ul style="list-style-type:square">' +
+							`<li class="MsoListBulletCxSpFirst" ${ level1 }>` +
+							'<span lang="EN-US"></span><span>Foo</span>' +
+							'</li>' +
+							'</ul>'
+						);
+					} );
+
+					it( 'ignores the marker if cannot be translated to list style feature', () => {
+						const styles = '@list l0:level1\n' +
+							'{mso-level-number-format:bullet;}';
+
+						const html = `<p class=MsoListBulletCxSpFirst ${ level1 }>` +
+							'<span lang=\'EN-US\'><span style=\'mso-list:Ignore\'>+<span>&nbsp;&nbsp;</span></span></span></span>' +
+							'<span>Foo</span>' +
+							'</p>';
+
+						const view = htmlDataProcessor.toView( html );
+
+						transformListItemLikeElementsIntoLists( view, styles );
+
+						expect( stringify( view ) ).to.equal(
+							'<ul>' +
+							`<li class="MsoListBulletCxSpFirst" ${ level1 }>` +
+							'<span lang="EN-US"></span><span>Foo</span>' +
+							'</li>' +
+							'</ul>'
+						);
+					} );
+				} );
+			} );
 		} );
 	} );