Page MenuHomePhabricator

Some characters in HTML5 fragments mess with wikitext
Closed, ResolvedPublic3 Story Points

Description

As reported in T175725: Deploy HTML5 sections to WMF production, some characters are problematic when used in wikitext anchor-encoded with html5 set as primary mode in $wgFragentMode.

  • <ref name="[]"> is broken because Cite uses wikitext for link generation. There's T29694 for it.
  • Some links like [{{fullurl:{{PAGENAME}}}}#{{anchorencode:[]}}] don't work anymore.

Event Timeline

MaxSem created this task.Nov 1 2017, 10:24 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 1 2017, 10:24 PM
kaldari set the point value for this task to 3.Nov 1 2017, 10:39 PM
cscott added a subscriber: cscott.Nov 2 2017, 4:36 PM

T176176 might be related, since it also related to wikitext-significant characters showing up in html5 ids.

MaxSem claimed this task.Nov 3 2017, 2:37 AM
MaxSem moved this task from Ready to In Development on the Community-Tech-Sprint board.

I have a silly question: why do we even use reference names in IDs? Because these IDs are also using reference numbers, they're not stable anyway.

cscott added a comment.Nov 4 2017, 2:57 AM

Good question. I would certainly support removing the wikitext-generated part of the ID.

Please don't miss {{anchorencode}} part of the task. Quite a lot of templates in ruwiki using {{anchorencode}} / mw.uri.anchorEncode() to encode anchor links have broken in many cases due to use of []. en:Module:Footnotes, for one, will break in many cases if you try delpoy to enwiki.

Arbnos added a subscriber: Arbnos.Nov 5 2017, 1:41 PM
MaxSem updated the task description. (Show Details)Nov 10 2017, 12:54 AM

Change 390356 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/Cite@master] Don't break when reference names contain []

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

Change 390356 had a related patch set uploaded (by Legoktm; owner: MaxSem):
[mediawiki/extensions/Cite@master] Don't break when reference names contain []

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

Good question. I would certainly support removing the wikitext-generated part of the ID.

I merged this patch, but I'd like to see a follow-up task to remove the name part of the ID entirely.

Change 390356 merged by jenkins-bot:
[mediawiki/extensions/Cite@master] Don't break when reference names contain []

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

MaxSem closed this task as Resolved.Nov 22 2017, 7:02 PM
MaxSem moved this task from Needs Review/Feedback to Q1 2018-19 on the Community-Tech-Sprint board.
DannyH moved this task from Estimated to Archive on the Community-Tech board.Dec 19 2017, 1:13 AM

I have a silly question: why do we even use reference names in IDs? Because these IDs are also using reference numbers, they're not stable anyway.

I can come up with at least one application: if the reference name is generated somewhere deep in the code (for example, if it is a hash of the reference content retrieved from Wikidata), there is no other way to learn it to reuse in a different place in an article. Or is it? @cscott