Page MenuHomePhabricator

HTML5's <time> tag and contents are dropped when text using it is copy & pasted into VisualEditor
Closed, ResolvedPublic1 Estimated Story Points

Description

I tried copy and pasting the string The concert starts at 20:00. from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time
in this diff: https://en.wikipedia.org/w/index.php?title=User:Quiddity_%28WMF%29/sandbox&diff=668495457&oldid=668240695
and it was saved with the full rich text as The concert starts at <time>20:00</time>.

Related discussion at T34545: MediaWiki should support <time> in WikiText (the request filed in 2011 for Wikitext to support the tag).

There are (as of today) 14 instances in mainspace at Enwiki: https://en.wikipedia.org/w/index.php?title=Special%3ASearch&profile=advanced&search=insource%3A%2F\%3Ctime\%3E%2F&fulltext=Search&ns0=1&profile=advanced
At least 1 was added whilst using the tool ProveIt: https://en.wikipedia.org/w/index.php?title=Sonia_Orin_Lyris&diff=prev&oldid=603019095
Others were added with VE, e.g. https://en.wikipedia.org/w/index.php?title=Elizabeth_Scarr&diff=632644339&oldid=632640602

We should decide how to deal with this. (Encourage/define, remove, other ?)


Originally reported at :en:WP:VEF with a pointer to this diff: https://fr.wikipedia.org/w/index.php?title=Bataille_du_d%C3%A9fil%C3%A9_de_Ver%C3%ADn&diff=next&oldid=116144125

Event Timeline

Quiddity raised the priority of this task from to Needs Triage.
Quiddity updated the task description. (Show Details)
Quiddity subscribed.
nshahquinn-wmf set Security to None.

Since this bug was filed, the behavior has switched to stripping the <time> entirely.

Jdforrester-WMF renamed this task from HTML5's <time> tag is included when text using it is copy & pasted into VisualEditor to HTML5's <time> tag and contents are dropped when text using it is copy & pasted into VisualEditor.Jan 18 2017, 7:05 PM

OK, I think we should just allow them in content and on paste then.

Jdforrester-WMF set the point value for this task to 1.

My bad, actually. The <time> is kept as an annotation, rather than being turned into a visible <time> tag. Unfortunately, it's a completely invisible annotation, so there's no indicator it's there, or any way to edit its attributes. Still, there's no data-loss now on paste / edit.

Change 333666 had a related patch set uploaded (by DLynch):
DatetimeAnnotation: flesh out model with datetime attribute

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

Change 333666 merged by jenkins-bot:
DatetimeAnnotation: flesh out model with datetime attribute

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

Change 334089 had a related patch set uploaded (by Jforrester):
Update VE core submodule to master (f1ed206)

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

Change 334089 merged by jenkins-bot:
Update VE core submodule to master (f1ed206)

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