Page MenuHomePhabricator

VisualEditor: Reference dialog retains style of copy/pasted contents
Closed, ResolvedPublic

Description

On fr.wp,
NemesisIII usually copy/pastes titles of articles in the reference dialog.
This led to this diff, https://fr.wikipedia.org/w/index.php?title=France_Roche&diff=prev&oldid=99244364, where the newly added link is among equal signs, as if its style was "Page title" rather than "Paragraph".

When I tried to replicate this behavior,
I got a slightly different result https://fr.wikipedia.org/w/index.php?title=Utilisateur%3AElitre_%28WMF%29%2FProve&diff=99382715&oldid=99382337.
Reference #2 is now... definitely different from the others (waaay bigger), and certainly not standard as it should be.


Version: unspecified
Severity: normal

Details

Reference
bz58689

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:36 AM
bzimport added a project: VisualEditor.
bzimport set Reference to bz58689.

This may be a case of 'working as designed': Rich copying and pasting means that the style of the copied/pasted contents is retained. This is a new feature, so users are surprised by this. We don't want to break formatting for references: titles should remain italicized, journal volumes should remain bolded, etc. However, perhaps it would be possible to set the contents of all refs to "Paragraph"?

I'm pretty sure it's working as intended, but I am not sure if it's helpful that it allows changing style to text (given it's a reference), and if there's a way to prevent that, because changing style to the single reference when you add it is not possible now.

I think keeping the formatting of a non-wiki contents is not really a good thing: every wiki has its own manual of style, to have a consistent look and feel in articles. There's almost no chance at all that a non-wiki contents will be formatted following the manual of style of the wiki.
There's seldom use to keep font family, font size, color, ... from an external contents.

(In reply to NicoV from comment #3)
Precisely.

There are good reasons to retain basic character formatting (e.g., italics) and linked URLs (e.g., the equivalent of [http://my.source.org Reliable Title]).

I suppose that font might be useful, if it has the effect of switching to a different language. I'm just not sure that we'll encounter that. <span lang="jv-java"> of course should not get dropped, and LTR/RTL switches are critical. Imagine a ref including both Arabic and a European language without this feature.

Problem with this is and other design decisions in VE is that the exception is privileged over the most common situation.

In most cases, you really don't want the formatting to be copied over like that when you're copying something from an external website:

  • italic, bold: probably ok
  • links: probably usually ok (and this is not really true, because manuals of style usually say that external links should not be in the text of the article, but as references or in an "external links" section)
  • everything else: usually not ok (I would say 99%), and even when it seems ok, it's not really a good idea. Why? Take the example of a different language: the notion should be kept in the end, but all wikis I know have defined a {{lang}} template to do that and discourage the use of <span lang="xxx">. And this is true for many things: even the links/italics/bold for a reference are usually handled by a template like {{cite web}} to have a consistent look&feel in wikipedia.

Copying from an other page of wikipedia is an other subject: for this, copying the full wikimarkup would be usually good.

NicoV, this bug is entirely about the reference dialog, so what you should do for refs is the only thing that we're talking about here. So if "manuals of style usually say that external links should not be in the text of the article, but as references", then we SHOULD retain these links in the refs.

Jdforrester-WMF changed the task status from Open to Stalled.Feb 2 2015, 7:24 PM

I've tested this again using headlines from three different news sites, and the reference dialog now seems to correctly strip all rich formatting. Closing.

nshahquinn-wmf set Security to None.