Page MenuHomePhabricator

Can't paste a pre-wrapped heading
Open, LowPublic

Description

Goal:

Copy the title from https://tools.ietf.org/html/rfc7725 (the HTML is <pre><span class="h1">An HTTP Status Code to Report Legal Obstacles</span></pre> ) and paste it into a table at the end of https://en.wikipedia.org/wiki/List_of_RFCs#Numerical_list

Steps to reproduce:

  1. Go to https://tools.ietf.org/html/rfc7725
  2. Triple-click on the title and copy it.
  3. Go to a page in VisualEditor and (rich/regular) paste it.

Results:

Upon pasting, an empty <pre> block (in Safari/Mac; probably not even that on Windows)). Upon saving, nothing.

Desired results:

The words, with or without the <pre> formatting.

Reported originally in Mozilla Firefox (45.0.1) and Google Chrome (49.0.2623.87 m) on Windows 7, 64-bit. Reproduced in Safari 9 on Mac 10.10.5. However, it works correctly[1] in Firefox 45 on my Mac.

[1] In Firefox, the page is saved as An HTTP Status Code to Report Legal Obstacles (14 leading spaces, and one trailing), which might not be entirely desirable.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Esanders renamed this task from Pasting rich text <pre><span>Sample</span></pre> results in empty <pre> block, and nothing upon save to Can't paste a pre-wrapped heading.Mar 23 2016, 5:26 PM
Esanders subscribed.

The heading is wrapped in an <h1> as well as the span. That gets alienated as you can't have multiple formats on one paragraph, then thrown away by the paste sanitizer.

Could you discard the formatting instead of the text?

Jdforrester-WMF moved this task from To Triage to Freezer on the VisualEditor board.