-
Notifications
You must be signed in to change notification settings - Fork 18
Provide support for pasting lists from google docs #72
Changes from 12 commits
173e44d
7c4f7dc
1111bea
11cbe07
348f3b6
419ff3d
3eda19c
4a566b2
5bf77e7
f6ee361
2fb7ddb
e8e12c9
6c9f2e9
975992e
cfb2a35
95c024f
3806a55
16ca74f
4aa476a
70495e8
68d155e
b8eaff4
861ba50
a6fa897
40c88a2
c9b208f
85c8764
4a1dd43
383b387
1a95ece
676730c
d2da715
5513c92
3d467da
0a56b5e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/** | ||
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
/** | ||
* @module paste-from-office/filters/common | ||
*/ | ||
|
||
/** | ||
* Removes paragraph wrapping content inside list item. | ||
* | ||
* @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} elementOrDocumentFragment | ||
* @param {module:engine/view/upcastwriter~UpcastWriter} writer | ||
*/ | ||
export function unwrapParagraph( elementOrDocumentFragment, writer ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe |
||
const iterableNodes = elementOrDocumentFragment.is( 'element' ) ? elementOrDocumentFragment.getChildren() : elementOrDocumentFragment; | ||
|
||
for ( const element of iterableNodes ) { | ||
if ( element.is( 'element', 'p' ) && element.parent.is( 'element', 'li' ) ) { | ||
unwrapSingleElement( element, writer ); | ||
} | ||
|
||
if ( element.is( 'element' ) && element.childCount ) { | ||
unwrapParagraph( element, writer ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly to the method below, I think that we can get rid of recursion here by inspectign children of the |
||
} | ||
} | ||
} | ||
|
||
/** | ||
* Moves nested list inside previous sibling element, what is a proper HTML standard. | ||
* | ||
* @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} elementOrDocumentFragment | ||
* @param {module:engine/view/upcastwriter~UpcastWriter} writer | ||
*/ | ||
export function moveNestedListToListItem( elementOrDocumentFragment, writer ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
// There are 2 situations which are fixed in the for loop: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be moved to the method description. |
||
// | ||
// 1. Move list to previous list item: | ||
// OL OL | ||
// |-> LI |-> LI | ||
// |-> OL |-> OL | ||
// |-> LI |-> LI | ||
// | ||
// 2. Unwrap nested list to avoid situation that UL or OL is direct child of another UL or OL. | ||
// OL OL | ||
// |-> LI |-> LI | ||
// |-> OL |-> OL | ||
// |-> OL |-> LI | ||
// | |-> OL |-> LI | ||
// | |-> OL | ||
// | |-> LI | ||
// |-> LI | ||
const iterableNodes = elementOrDocumentFragment.is( 'element' ) ? elementOrDocumentFragment.getChildren() : elementOrDocumentFragment; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find this method a bit complicated because of the recursion. I did small tests and it seems that we can get rid of the recursion here by using tree walker (by creating a range inside document fragment). I'd go with something like this: for ( const value of writer.createRangeIn( elementOrDocumentFragment ) ) {
const element = value.item;
// 2.
if ( element.is( 'li' ) ) {
const next = element.nextSibling;
if ( next && isList( next ) ) {
writer.remove( next );
writer.insertChild( element.childCount, next, element );
}
}
// 1.
if ( isList( element ) ) {
let firstChild = element.getChild( 0 );
while ( isList( firstChild ) ) {
unwrapSingleElement( firstChild, writer );
firstChild = element.getChild( 0 );
}
}
} I think that using tree walker here should be safe as long we mangle with a node after (not a node before) or it's children of current walker value. |
||
|
||
for ( const element of iterableNodes ) { | ||
if ( isList( element ) && isList( element.parent ) ) { | ||
// 1. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some text would be nice - ie |
||
const previous = element.previousSibling; | ||
|
||
writer.remove( element ); | ||
writer.insertChild( previous.childCount, element, previous ); | ||
|
||
// 2. | ||
let firstChild = element.getChild( 0 ); | ||
|
||
while ( isList( firstChild ) ) { | ||
unwrapSingleElement( firstChild, writer ); | ||
firstChild = element.getChild( 0 ); | ||
} | ||
} | ||
|
||
if ( element.is( 'element' ) && element.childCount ) { | ||
moveNestedListToListItem( element, writer ); | ||
} | ||
} | ||
} | ||
|
||
function isList( element ) { | ||
return element.is( 'element', 'ol' ) || element.is( 'element', 'ul' ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ps.: this applies to other |
||
} | ||
|
||
function unwrapSingleElement( element, writer ) { | ||
const parent = element.parent; | ||
const childIndex = parent.getChildIndex( element ); | ||
|
||
writer.remove( element ); | ||
writer.insertChild( childIndex, element.getChildren(), parent ); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
/** | ||
* @module paste-from-office/normalizers/genericnormalizer | ||
*/ | ||
|
||
import { unwrapParagraph, moveNestedListToListItem } from '../filters/common'; | ||
import UpcastWriter from '@ckeditor/ckeditor5-engine/src/view/upcastwriter'; | ||
|
||
/** | ||
* Normalizer for the content pasted from different sources, where we can detect wrong syntax. | ||
* | ||
* @implements module:paste-from-office/normalizer~Normalizer | ||
*/ | ||
export default class GenericNormalizer { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we need GenericNormalizer. It duplicates fixes for GD normalizer. It probably might also duplicate MSWord normalizer. Right now I don't have a clear idea of how to deal with those fixes - they might be helpfull generally speaking one can copy such weird list indentation from various sources. But OTOH such argument is also valid for every other filter. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm thinking about removing this ATM but I'll give it another thought. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here are the details and comments about why it's important: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it happen only on Safari? If so I'd still ad some env checking to be sure that this normalizer doesn't fire up too often. @mlewand WDYT? OTOH this normalizer will always fix pasted lists (even from other sources) so it may be beneficial. I see two routes:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would not stick to "List" name here. As content is unrecognizable for any filter. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So in such cases better could be
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jodator @msamsel I took a peek at it and I see that:
Since still pretty much all the cases will be handled on safari except this particular oddity, let's wait for some real life cases where it will be useful. Until then let's extract mentioned Safari problem as a separate issue and put it to backlog. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jodator I removed this normalizer. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I extracted this case to separate issue: #75 |
||
/** | ||
* @inheritDoc | ||
*/ | ||
isActive() { | ||
return true; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
execute( data ) { | ||
const writer = new UpcastWriter(); | ||
|
||
moveNestedListToListItem( data.content, writer ); | ||
unwrapParagraph( data.content, writer ); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
*/ | ||
|
||
import removeBoldWrapper from '../filters/removeboldwrapper'; | ||
import { unwrapParagraph, moveNestedListToListItem } from '../filters/common'; | ||
import UpcastWriter from '@ckeditor/ckeditor5-engine/src/view/upcastwriter'; | ||
|
||
const googleDocsMatch = /id=("|')docs-internal-guid-[-0-9a-f]+("|')/i; | ||
|
@@ -32,5 +33,7 @@ export default class GoogleDocsNormalizer { | |
const writer = new UpcastWriter(); | ||
|
||
removeBoldWrapper( data.content, writer ); | ||
moveNestedListToListItem( data.content, writer ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this trick also closes the #19? Would be sweet if we could add this also to the MSWord normalizer :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If so I 'd try to refactor the MSWordNormalizer if doable in 2-3 hours. Pulling up the upcast writer up from inner methods like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But only if this PR would also fix the MSWord lists. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately, it requires some deeper analysis and most probably attaching somewhere inside word filter. :( a simple adding new filter like this:
or at the beginning of transforming content doesn't work. It looks like this uber-filter for MS Word makes all lists flat and it doesn't keep information about indentation. |
||
unwrapParagraph( data.content, writer ); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; | |
import GoogleDocsNormalizer from './normalizers/googledocsnormalizer'; | ||
import MSWordNormalizer from './normalizers/mswordnormalizer'; | ||
import Clipboard from '@ckeditor/ckeditor5-clipboard/src/clipboard'; | ||
import GenericNormalizer from './normalizers/genericnormalizer'; | ||
|
||
/** | ||
* The Paste from Office plugin. | ||
|
@@ -49,6 +50,7 @@ export default class PasteFromOffice extends Plugin { | |
init() { | ||
const editor = this.editor; | ||
const normalizers = []; | ||
const genericNormalizer = new GenericNormalizer(); | ||
|
||
normalizers.push( new MSWordNormalizer() ); | ||
normalizers.push( new GoogleDocsNormalizer() ); | ||
|
@@ -66,6 +68,10 @@ export default class PasteFromOffice extends Plugin { | |
if ( activeNormalizer ) { | ||
activeNormalizer.execute( data ); | ||
|
||
data.isTransformedWithPasteFromOffice = true; | ||
} else { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't need that. If you'd add the Might be invalid if we don't want |
||
genericNormalizer.execute( data ); | ||
|
||
data.isTransformedWithPasteFromOffice = true; | ||
} | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
import listInTable from './list-in-table/input.html'; | ||
import listInTableNormalized from './list-in-table/normalized.html'; | ||
import listInTableModel from './list-in-table/model.html'; | ||
|
||
export const fixtures = { | ||
input: { | ||
listInTable | ||
}, | ||
normalized: { | ||
listInTable: listInTableNormalized | ||
}, | ||
model: { | ||
listInTable: listInTableModel | ||
} | ||
}; | ||
|
||
export const browserFixtures = {}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<div dir="ltr" style="font-family: -webkit-standard; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); margin-left: 0pt;"><table style="border: none; border-collapse: collapse; width: 468pt;"><tbody><tr style="height: 50pt;"><td style="border: 1pt solid rgb(0, 0, 0); vertical-align: top; padding: 5pt;"><ul style="margin-top: 0pt; margin-bottom: 0pt;"><li dir="ltr" style="list-style-type: disc; font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: 400; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; text-decoration: none; vertical-align: baseline; white-space: pre;"><p dir="ltr" style="line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: 400; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">One</span></p></li><li dir="ltr" style="list-style-type: disc; font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: 400; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; text-decoration: none; vertical-align: baseline; white-space: pre;"><p dir="ltr" style="line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: 400; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Two</span></p></li><li dir="ltr" style="list-style-type: disc; font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: 400; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; text-decoration: none; vertical-align: baseline; white-space: pre;"><p dir="ltr" style="line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt;"><span style="font-size: 11pt; font-family: Arial; color: rgb(0, 0, 0); background-color: transparent; font-weight: 400; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Three</span></p></li></ul></td></tr></tbody></table></div> |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<table><tableRow><tableCell><listItem listIndent="0" listType="bulleted">One</listItem><listItem listIndent="0" listType="bulleted">Two</listItem><listItem listIndent="0" listType="bulleted">Three</listItem></tableCell></tableRow></table> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<div dir="ltr" style="-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;caret-color:rgb(0, 0, 0);color:rgb(0, 0, 0);font-family:-webkit-standard;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;margin-left:0pt;orphans:auto;text-align:start;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;widows:auto;word-spacing:0px"><table style="border:none;border-collapse:collapse;width:468pt"><tbody><tr style="height:50pt"><td style="border:1pt solid rgb(0, 0, 0);padding:5pt;vertical-align:top"><ul style="margin-bottom:0pt;margin-top:0pt"><li dir="ltr" style="background-color:transparent;color:rgb(0, 0, 0);font-family:Arial;font-size:11pt;font-style:normal;font-variant-caps:normal;font-variant-east-asian:normal;font-variant-ligatures:normal;font-variant-position:normal;font-weight:400;list-style-type:disc;text-decoration:none;vertical-align:baseline;white-space:pre"><span style="background-color:transparent;color:rgb(0, 0, 0);font-family:Arial;font-size:11pt;font-style:normal;font-variant-caps:normal;font-variant-east-asian:normal;font-variant-ligatures:normal;font-variant-position:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">One</span></li><li dir="ltr" style="background-color:transparent;color:rgb(0, 0, 0);font-family:Arial;font-size:11pt;font-style:normal;font-variant-caps:normal;font-variant-east-asian:normal;font-variant-ligatures:normal;font-variant-position:normal;font-weight:400;list-style-type:disc;text-decoration:none;vertical-align:baseline;white-space:pre"><span style="background-color:transparent;color:rgb(0, 0, 0);font-family:Arial;font-size:11pt;font-style:normal;font-variant-caps:normal;font-variant-east-asian:normal;font-variant-ligatures:normal;font-variant-position:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Two</span></li><li dir="ltr" style="background-color:transparent;color:rgb(0, 0, 0);font-family:Arial;font-size:11pt;font-style:normal;font-variant-caps:normal;font-variant-east-asian:normal;font-variant-ligatures:normal;font-variant-position:normal;font-weight:400;list-style-type:disc;text-decoration:none;vertical-align:baseline;white-space:pre"><span style="background-color:transparent;color:rgb(0, 0, 0);font-family:Arial;font-size:11pt;font-style:normal;font-variant-caps:normal;font-variant-east-asian:normal;font-variant-ligatures:normal;font-variant-position:normal;font-weight:400;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Three</span></li></ul></td></tr></tbody></table></div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
import nestedOrderedList from './nested-ordered-lists/input.html'; | ||
import nestedOrderedListNormalized from './nested-ordered-lists/normalized.html'; | ||
import nestedOrderedListModel from './nested-ordered-lists/model.html'; | ||
|
||
import mixedList from './mixed-list/input.html'; | ||
import mixedListNormalized from './mixed-list/normalized.html'; | ||
import mixedListModel from './mixed-list/model.html'; | ||
|
||
import repeatedlyNestedList from './repeatedly-nested-list/input.html'; | ||
import repeatedlyNestedListNormalized from './repeatedly-nested-list/normalized.html'; | ||
import repeatedlyNestedListModel from './repeatedly-nested-list/model.html'; | ||
|
||
export const fixtures = { | ||
input: { | ||
nestedOrderedList, | ||
mixedList, | ||
repeatedlyNestedList | ||
}, | ||
normalized: { | ||
nestedOrderedList: nestedOrderedListNormalized, | ||
mixedList: mixedListNormalized, | ||
repeatedlyNestedList: repeatedlyNestedListNormalized | ||
}, | ||
model: { | ||
nestedOrderedList: nestedOrderedListModel, | ||
mixedList: mixedListModel, | ||
repeatedlyNestedList: repeatedlyNestedListModel | ||
} | ||
}; | ||
|
||
export const browserFixtures = {}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<meta charset='utf-8'><meta charset="utf-8"><b style="font-weight:normal;" id="docs-internal-guid-6aba46e4-7fff-ffbf-43f7-6080e7ecadb8"><ol style="margin-top:0pt;margin-bottom:0pt;"><li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">1</span></p></li><ul style="margin-top:0pt;margin-bottom:0pt;"><li dir="ltr" style="list-style-type:circle;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">A</span></p></li><ol style="margin-top:0pt;margin-bottom:0pt;"><li dir="ltr" style="list-style-type:lower-roman;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">1</span></p></li></ol></ul><li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">2</span></p></li><li dir="ltr" style="list-style-type:decimal;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">3</span></p></li><ul style="margin-top:0pt;margin-bottom:0pt;"><li dir="ltr" style="list-style-type:circle;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">A</span></p></li><li dir="ltr" style="list-style-type:circle;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">B</span></p></li></ul></ol><ul style="margin-top:0pt;margin-bottom:0pt;"><li dir="ltr" style="list-style-type:disc;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">A</span></p></li><ol style="margin-top:0pt;margin-bottom:0pt;"><li dir="ltr" style="list-style-type:lower-alpha;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">1</span></p></li><li dir="ltr" style="list-style-type:lower-alpha;font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;"><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap;">2</span></p></li></ol></ul></b> |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<listItem listIndent="0" listType="numbered">1</listItem><listItem listIndent="1" listType="bulleted">A</listItem><listItem listIndent="2" listType="numbered">1</listItem><listItem listIndent="0" listType="numbered">2</listItem><listItem listIndent="0" listType="numbered">3</listItem><listItem listIndent="1" listType="bulleted">A</listItem><listItem listIndent="1" listType="bulleted">B</listItem><listItem listIndent="0" listType="bulleted">A</listItem><listItem listIndent="1" listType="numbered">1</listItem><listItem listIndent="1" listType="numbered">2</listItem> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep them separated like
removeBoldWrapper()
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those filters are for lists and only list so they should go to the
lists.js
IMO.Now I'm worried that we're going to introduce some mess in the
/filters
namespace. So at the moment, I'd move those 2 methods to thelists.js
(so do not create another 2 files) And we can iron out the layout of the filters later on when we gonna have more filters.