Page MenuHomePhabricator

Copy-pasting numbered headings from Google Doc to VisualEditor fails
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

I made a Google Doc with reproducible steps, you can see (and use it to copy/paste) here: https://docs.google.com/document/d/1nU2rYurrkOQ9HhEmJW_rEwXpDjPxmJIwVwoYkefJEHM/edit#heading=h.whecslmaf5g3 (Problem #1)

The steps are:

  • Create a Google Doc with headings
  • Make the headings "numbered" in the Google Doc
  • Copy the entire document (or even just the heading) to VisualEditor page

What happens?:
Visually, nothing, which was odd. The console has an error:

Uncaught Error: Cannot insert mwHeading even after closing all containing nodes (at index 2)

What should have happened instead?:
Either strip the numbering, or translate the numbering to a preceding number (1. xxxx) ?
Either way, this should at least not fail, and give some indicator to the user that something was off with the original text.

Event Timeline

Change 930652 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/VisualEditor@master] Unwrap headings in lists when pasting external HTML

https://gerrit.wikimedia.org/r/930652

Change 930652 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Unwrap headings in lists (and <blockquote>) when pasting external HTML

https://gerrit.wikimedia.org/r/930652

ppelberg claimed this task.