Page MenuHomePhabricator

VisualEditor: Pasting should remove formats (and other types of content?) that aren't allowed in the target
Closed, ResolvedPublic


Add a caption to an image without having to type out the name by hand.

Steps to Reproduce:

  1. Add an image in VisualEditor (e.g., an image of a person). Open the caption dialog.
  2. Go to another window (e.g., an article about the person) and copy a =Name= from the article title.
  3. Paste the rich text into the caption.

Actual Results:
The pasted text retained rich formatting. It is not possible to remove the =Heading= formatting. Only '''text''' <s>formatting</s> can be added or removed in that dialog. So if you copy the article title from [[George Washington]] and paste it into the caption box, then it produces this wikitext:

<span dir="auto">George Washington</span>

and there is no way to remove the formatting.

Expected Results:
That either you could remove the formatting, or ideally, that the caption box would strip the unwanted formatting automagically. There's no obvious reason why someone would need or want a ==Heading== of any level in a caption.

Reproducible: Didn't try

Confirmed in Safari 6 and Firefox 26

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:41 AM
bzimport set Reference to bz59603.

SurfaceWidgets currently aren't even implementing the main surface's paste rules.

Change 110960 had a related patch set uploaded by Esanders:
Implement surface paste rules for media/ref dialogs

Change 110960 merged by jenkins-bot:
Implement surface paste rules for media/ref dialogs

Disallowed inside references: references, reference lists, lists, definition lists, tables. Headings can be pasted but are converted to paragraphs.

Disallowed inside image captions: lists, definition lists, tables. Headings can be pasted but are converted to paragraphs.

What does "disallowed" mean? People do put lists into refs. See for an example.

It is important that people be able to paste something that was in a list format, even if it was converted into a paragraph upon pasting.

We mean discouraged. At the moment there's a Parsoid bug that breaks list rendering, but we can revisit that decision if users really want it. And yes, the patch will convert lists to paragraphs.

Closing for now, though we may make further changes about removing or allowing certain kinds of formatting in future.