Okay, here's the weird bug I mentioned in KIT today:
I found that when I browse to /w/index.php?title=SomePage&veaction=edit (that is, not /wiki/SomePage?veaction=edit) and try to add transclusions with links inside them (e.g. to TargetPage), they point to /w/TargetPage, which is invalid.
- It wouldn't surprise me if this is a duplicate.
- Don't we deal with this anywhere else?
- The problem begins with our call to $.parseHTML in MWTransclusionNode#onParseSuccess, which takes all of Parsoid's ./TargetPage links and generates DOM link elements assuming they are relative to the current URL.
Roan's notes from IRC:
<RoanKattouw> Yeah there is something somewhere to do href remapping
<RoanKattouw> GeneratedContentNode already does href computation
<RoanKattouw> This should be *working*
<RoanKattouw> See ve.ce.GeneratedContentNode.prototype.getRenderedDomElements and the stuff about computed attributes
<RoanKattouw> I first thought that we should be computing attributes after cloning into the right document, but that's wrong, because that's cloning into the view document
<RoanKattouw> We need to resolve with respect to the model document
<RoanKattouw> Which... oooh but they're not in the right document at that time, I guess?