Page MenuHomePhabricator

VisualEditor: Place redirects at the top of the page, not the bottom
Closed, ResolvedPublic

Description

The proper order is #REDIRECT[[Whatever]], then categories and other stuff. If you place the redirect anywhere other than the very top of the page, it won't work.


Version: unspecified
Severity: trivial

Details

Reference
bz61862

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:51 AM
bzimport set Reference to bz61862.

Logically, Parsoid should decide where in the page such things go (right now it just renders in place); VisualEditor could hack around this by putting it at the top of the HTML, but that's not a scalable fix (and will likely break other things).

Parsoid, what do you think?

If "rendering in place" means "where the cursor is", then that's not happening. It's placing the redirect at the bottom of the page even if your cursor is at the top or in the middle.

Change 115287 had a related patch set uploaded by Jforrester:
Always try to put redirects at index 0, offset 0

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

(In reply to WhatamIdoing from comment #2)

If "rendering in place" means "where the cursor is", then that's not
happening. It's placing the redirect at the bottom of the page even if your
cursor is at the top or in the middle.

No, it's rendering "in place" in the HTML document; VE just puts meta-items at the end of the HTML string (because internal logic of what MW's parser does and doesn't prefer is a decision for Parsoid), so Parsoid renders this at the end of the wikitext, which helpfully doesn't work.

(In reply to Gerrit Notification Bot from comment #3)

Change 115287 had a related patch set uploaded by Jforrester:
Always try to put redirects at index 0, offset 0

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

This is a hack to make VE try to insert it right at the top, which may not work in all cases but at least should patch over the issue.

Change 115309 had a related patch set uploaded by Catrope:
Always try to put redirects at index 0, offset 0

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

Change 115287 merged by jenkins-bot:
Always try to put redirects at index 0, offset 0

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

Moving back to VE; Position of inline metadata is the client's responsibility. Our long-term solution is to move that metadata out of the content altogether.

(In reply to Gabriel Wicke from comment #7)

Moving back to VE; Position of inline metadata is the client's
responsibility. Our long-term solution is to move that metadata out of the
content altogether.

This is semantically non-positional meta-data that breaks if not in a particular syntactical position…

Change 115309 merged by jenkins-bot:
Always try to put redirects at index 0, offset 0

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

Will mark this as fixed in favour of Parsoid bug 53508 then.