Page MenuHomePhabricator

VisualEditor: Pasting multi-level lists is broken
Closed, ResolvedPublic

Description

Pasting a multi-level list like the following does not work. No output is reflected (the paste doesn't insert anything to the Visual Editor page). The expected behavior is a list is created, which matches the format of the source list.

  1. A list like this
    1. Does not work
  2. Nothing is seen in output.

The behavior changes depending on which application is used to copy the list. Specifically, we used One Note to create the multi-level list. The clipboard HTML for the list is the following:

Version:1.0
StartHTML:0000000105
EndHTML:0000001594
StartFragment:0000000527
EndFragment:0000001554

<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=OneNote.File>
<meta name=Generator content="Microsoft OneNote 15">
</head>

<body lang=en-US style='font-family:Calibri;font-size:11.0pt'>
<!--StartFragment-->

<ol type=1 style='margin-left:.375in;direction:ltr;unicode-bidi:embed;
 margin-top:0in;margin-bottom:0in;font-family:Calibri;font-size:11.0pt;
 font-weight:normal;font-style:normal'>
 <li value=1 style='margin-top:0;margin-bottom:0;vertical-align:middle'><span
     style='font-family:Calibri;font-size:11.0pt;font-weight:normal;font-style:
     normal;font-family:Calibri;font-size:11.0pt'>Test is good</span></li>
 <ol type=a style='margin-left:.375in;direction:ltr;unicode-bidi:embed;
  margin-top:0in;margin-bottom:0in;font-family:Calibri;font-size:11.0pt;
  font-weight:normal;font-style:normal'>
  <li value=1 style='margin-top:0;margin-bottom:0;vertical-align:middle'><span
      style='font-family:Calibri;font-size:11.0pt;font-weight:normal;
      font-style:normal;font-family:Calibri;font-size:11.0pt'>Test multilevel</span></li>
 </ol>
 <li style='margin-top:0;margin-bottom:0;vertical-align:middle'><span
     style='font-family:Calibri;font-size:11.0pt'>Multilevel is good</span></li>
</ol>

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

</html>

Even some guidance as to where the issue is would be helpful! I'm lost as to where to start looking for the fix.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 7 2019, 9:13 PM

This HTML is invalid. The second <ol> element should be nested inside the preceding <li> element, rather than directly inside the first <ol> element. <ol> elements may only have <li> elements as children (https://www.w3.org/TR/html52/grouping-content.html#the-ol-element).

Luckily for you, One Note is not the only application that produces such malformed output, and we already have a workaround in place that should allow us to accept it (T98100).

It might not work in this case for the same reasons as the recently reported issue with macOS Notes (T211516). That one should be already fixed. Can you check if the problem still occurs with the latest Git master of VisualEditor?

osorio-juan-microsoft closed this task as Resolved.Jan 9 2019, 1:02 AM
osorio-juan-microsoft claimed this task.

I see, that makes sense, thanks matmarex! This specific issue seems to have been fixed on VisualEditor (master, 9e2b9c6). Thanks!

Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptJan 9 2019, 1:02 AM