Page MenuHomePhabricator

Clean up mess from copy-pasted tables
Closed, ResolvedPublic1 Estimated Story Points

Description

I pasted a table into VisualEditor. CSV imports are working really well for me, but rich copying and pasting a table resulted in a lot of this stuff:

colspan="1" rowspan="1" id="banner_0_0_0_header_0" class="header Editable"

I'd like to see meaningless text removed automatically.

Event Timeline

Whatamidoing-WMF raised the priority of this task from to Needs Triage.
Whatamidoing-WMF updated the task description. (Show Details)

@Whatamidoing-WMF, can you give an example of a table or file that causes these problems? I just tried copy-and-pasting from a CSV file open in LibreOffice, and it worked fine. Thanks!

nshahquinn-wmf set Security to None.

I encountered this when copying a table off the Qualtrics website. CSV file importing is not the problem; rich coping and pasting of heavily formatted tables is the problem.

@Whatamidoing-WMF, maybe you could paste the Qualtrics table in a Google Doc (or something) and link that doc here so we have a clear test case?

VE should be stripping all HTML attributes for external paste, so can we get precise reproduction steps?

Change 267287 had a related patch set uploaded (by Esanders):
MWTable: use new sanitization method

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

I couldn't reproduce 'id' preservation, but col/rowspan=1 is still and issue after this fix. Unfortunately we don't yet have an MWTableCellNode class so the fix is not quite as trivial

Jdforrester-WMF assigned this task to Esanders.
Jdforrester-WMF removed a project: Patch-For-Review.
Jdforrester-WMF edited a custom field.

Change 267287 merged by jenkins-bot:
MWTable: use new sanitization method

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