Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[List start/reversed] Add support to Paste From Office plugin #11043

Closed
CatStrategist opened this issue Dec 23, 2021 · 7 comments · Fixed by #11094
Closed

[List start/reversed] Add support to Paste From Office plugin #11043

CatStrategist opened this issue Dec 23, 2021 · 7 comments · Fixed by #11094
Assignees
Labels
package:list package:paste-from-office squad:core Issue to be handled by the Core team. type:task This issue reports a chore (non-production change) and other types of "todos".

Comments

@CatStrategist
Copy link
Contributor

CatStrategist commented Dec 23, 2021

Provide a description of the task

Paste From Office plugin should support List start/reversed functionality.

Reversed lists

Reversed lists are not implemented in Word, the only way to do reversed list is to fake them by using paragraphs with numbering and the beginning, so most likely no work to do here.

Higher index start

When list in Word starts with higher index than 1 (e.g. 3) and is pasted from Word to CKEditor and Paste From Office plugin is enabled then index of pasted list starts from 1 instead of 3.

📃 Other details

  • Installed CKEditor plugins: List, Paste From Office
@CatStrategist CatStrategist added type:task This issue reports a chore (non-production change) and other types of "todos". package:list package:paste-from-office squad:core Issue to be handled by the Core team. labels Dec 23, 2021
@Reinmar
Copy link
Member

Reinmar commented Dec 30, 2021

Results in:



<body lang=en-PL style='tab-interval:36.0pt;word-wrap:break-word'>
<!--StartFragment-->

<p class=MsoListParagraphCxSpFirst style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![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 style='mso-list:Ignore'>3.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span dir=LTR></span><span lang=PL
style='mso-ansi-language:PL'>A<o:p></o:p></span></p>

<p class=MsoListParagraphCxSpMiddle style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![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 style='mso-list:Ignore'>4.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span dir=LTR></span><span lang=PL
style='mso-ansi-language:PL'>B<o:p></o:p></span></p>

<p class=MsoListParagraphCxSpLast style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![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 style='mso-list:Ignore'>5.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span dir=LTR></span><span lang=PL
style='mso-ansi-language:PL'>C<o:p></o:p></span></p>

<p class=MsoNormal><span lang=PL style='mso-ansi-language:PL'>X<o:p></o:p></span></p>

<p class=MsoListParagraphCxSpFirst style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![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 style='mso-list:Ignore'>6.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span dir=LTR></span><span lang=PL
style='mso-ansi-language:PL'>D<o:p></o:p></span></p>

<p class=MsoListParagraphCxSpMiddle style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![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 style='mso-list:Ignore'>7.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span dir=LTR></span><span lang=PL
style='mso-ansi-language:PL'>E<o:p></o:p></span></p>

<p class=MsoListParagraphCxSpLast style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![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 style='mso-list:Ignore'>8.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span dir=LTR></span><span lang=PL
style='mso-ansi-language:PL'>F<o:p></o:p></span></p>

<!--EndFragment-->
</body>

@Reinmar
Copy link
Member

Reinmar commented Dec 30, 2021

Unfortunately, it's more complex due to different styles for numbered lists – they may also use e.g. roman numbers:

<p class=MsoListParagraphCxSpFirst style='text-indent:-36.0pt;mso-text-indent-alt:
-18.0pt;mso-list:l0 level1 lfo1'><![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 style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;
</span>vii.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span dir=LTR></span><span lang=PL
style='mso-ansi-language:PL'>Aaa<o:p></o:p></span></p>

<p class=MsoListParagraphCxSpMiddle style='text-indent:-36.0pt;mso-text-indent-alt:
-18.0pt;mso-list:l0 level1 lfo1'><![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 style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'><span
style='mso-spacerun:yes'> </span></span>viii.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span dir=LTR></span><span lang=PL
style='mso-ansi-language:PL'>Dasdsd<o:p></o:p></span></p>

<p class=MsoListParagraphCxSpLast style='text-indent:-36.0pt;mso-text-indent-alt:
-18.0pt;mso-list:l0 level1 lfo1'><![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 style='mso-list:Ignore'><span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;
</span>ix.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span dir=LTR></span><span lang=PL
style='mso-ansi-language:PL'>sfsdf<o:p></o:p></span></p>

@Reinmar
Copy link
Member

Reinmar commented Dec 30, 2021

@Reinmar
Copy link
Member

Reinmar commented Dec 30, 2021

Corner cases:

  • Subsequent lists with restarted numbering: 4,5,6...2,3,4. 

    • If we support this in lists already – let's add a test and support for that. If not – let's add a test that it doesn't work (gets merged into a single list).
      • Update: we DO support such lists 
  • We definitely don't support 1,2,3...1,2,3 because both have start index == 1 (so both lists have the same set of attributes).

  • If we'll run into any issues with lists, let's ignore those – they are out of the scope here.

@arkflpc arkflpc self-assigned this Jan 10, 2022
@arkflpc
Copy link
Contributor

arkflpc commented Jan 11, 2022

It's actually a lot simpler. In styles there is:

mso-level-start-at:3

for every kind of list

niegowski added a commit that referenced this issue Jan 11, 2022
…art-index

Feature (paste-from-office): Adds support for start index in ordered lists. Closes #11043.
@AnnaTomanek AnnaTomanek added this to the iteration 50 milestone Jan 12, 2022
@godai78
Copy link
Contributor

godai78 commented Jan 12, 2022

OK, so I tested it in Word online (I have no Word on my mac here, but will try to test it later over LAN from my WIn7).

And the paste failed like totally, not pasting the numbered list as a list at all. So somebody might want to have a look at it.

@godai78
Copy link
Contributor

godai78 commented Jan 13, 2022

It works, however, when I used a boxed Word 2010 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:list package:paste-from-office squad:core Issue to be handled by the Core team. type:task This issue reports a chore (non-production change) and other types of "todos".
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants