Last modified: 2013-12-06 21:55:14 UTC
When you put a [[Pagename]] link in Flow, Parsoid generates a link of the form <a rel="mw:WikiLink" href="./Pagename" data-parsoid="{&qu blah blah ... Note it's a relative link, not an absolute link. This works if you are viewing /wiki/User_talk:SomeBoard , but if you view a permalink, or view a diff, or even just http://ee-flow.wmflabs.org/w/index.php?title=User_talk:Spage , the relative href to /w/index.php becomes a link to /w/Pagename, which is a 404. This feels like a Parsoid problem, but it might be addressed by ErikB's comment in ParsoidUtils.php, // @todo needs a big refactor to get a page title in here, fake Main_Page for now (Huge props to quiddity for noticing this one.)
The WMF core features team tracks this bug on Mingle card https://mingle.corp.wikimedia.org/projects/flow/cards/457, but people from the community are welcome to contribute here and in Gerrit.
On ee-flow labs instance, invoking Parsoid with $ curl localhost:8000/localhost/ -d wt='[[Pagename]] here' produces ... <base href="http://ee-flow.wmflabs.org/wiki/Main Page"/> </head> <body data-parsoid='{"dsr":[0,318,0,0]}'> <p data-parsoid='{"dsr":[0,318,0,0]}'> <a rel="mw:WikiLink" href="./Pagename" data-parsoid='{"stx":"simple","a":{"href":"./Pagename"},"sa":{"href":"Pagename"},"dsr":[0,313,2,2]}'>Pagename</a> here </p> ... Note the base href, which will make the href have the right /wiki/ prefix regardless of the current URL. But Flow's parsing of the HTML returned by Parsoid ignores the base href, and it doesn't set base href in its own HTML HEAD. Flow could do this (assuming the base href will be the same for all items in the Flow board), , or it could parse the HTML, or the the Parsoid API could have an option to generate full paths. The HTML for [[Pagename]] on a regular wiki page is an absolute path -- href="/wiki/Pagename" , so Parsoid's behavior is different. Note that some day a user's "My active threads" Flow board might show conversations from multiple wikis, so absolute URLs might be useful, some day.
Change 95563 had a related patch set uploaded by EBernhardson: Hackish method of respecting parsoid base href https://gerrit.wikimedia.org/r/95563
*** Bug 57161 has been marked as a duplicate of this bug. ***
Change 96189 had a related patch set uploaded by EBernhardson: Workaround for relative links in /w/index.php https://gerrit.wikimedia.org/r/96189
Change 95563 abandoned by EBernhardson: Hackish method of respecting parsoid base href Reason: Going a different direction for the temporary fix, https://gerrit.wikimedia.org/r/96189 https://gerrit.wikimedia.org/r/95563
Change 96189 merged by jenkins-bot: Workaround for relative links in /w/index.php https://gerrit.wikimedia.org/r/96189