Redirect creation from the editor does not work when target page's title starts with <
Categories
(developer.mozilla.org Graveyard :: Editing, enhancement, P1)
Tracking
(Not tracked)
People
(Reporter: sphinx_knight, Assigned: dflanagan+bugzilla)
Details
(Keywords: in-triage, Whiteboard: [specification][type:bug])
What did you do?
- Opened a page to edit it
- Used the editor UI button to create a redirect to https://developer.mozilla.org/en-US/docs/Web/CSS/timing-function
What happened?
The created content was just "<p>REDIRECT</p>" (no link)
What should have happened?
A "normal" redirect should have been created by adding the following content in the document:
<p>REDIRECT <a class="redirect" href="/en-US/docs/Web/CSS/timing-function"><timing-function></a></p>
Actually, I don't really care if "<" and ">" are escaped in the text do the expected result could (to me) be:
<p>REDIRECT <a class="redirect" href="/en-US/docs/Web/CSS/timing-function">timing-function</a></p>
Is there anything else we should know?
I've created test pages:
A. https://developer.mozilla.org/fr/docs/User:SphinxKnight/middle%3Cbracket (title "middle<bracket")
B. https://developer.mozilla.org/fr/docs/User:SphinxKnight/%3Cleftbracket (title "<leftbracket")
C. https://developer.mozilla.org/fr/docs/User:SphinxKnight/rightbracket%3E (title "rightbracket>")
The redirect "edition" works both for B and C. The text content of the <a> element is stripped from whatever comes after "<".
Bug created after https://bugzilla.mozilla.org/show_bug.cgi?id=1520413
If that may help https://github.com/mozilla/kuma/blob/master/kuma/static/js/libs/ckeditor/source/plugins/mdn-redirect/dialogs/mdn-redirect.js#L83 seems to be where something happens
Assignee | ||
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 2•6 years ago
|
||
A fix is ready for review here: https://github.com/mozilla/kuma/pull/5247
Thanks Julien for pointing directly to the plugin file that needed to be fixed. That made this fix super-easy.
Comment 3•6 years ago
|
||
This has been deployed. The HTML inserted is now properly escaped:
<p>REDIRECT <a class="redirect" href="/en-US/docs/Web/CSS/timing-function"><timing-function></a></p>
Updated•5 years ago
|
Description
•