Thread:Extension talk:WYSIWYG/Bug when parsing inside an external link/reply (4)

I did not test this with internal links but it seems that function of MW " Linker::makeExternalLink" which is causing the problem is not used in case link is internal, it is only used when link is external. Based on comments in " Linker::makeExternalLink" reason to html encoding is that "...This means that users can paste URLs directly into the text...".

When wysiwyg is parsing wikitext to html (CKeditorParser.body.php->internalParse) it first processes some of the elements of page and also hides some of them from parser of MW which then does conversion of common objects of page into html (using parent::internalParse which is located in includes/parser/Parser.php file of MW). After this wysiwyg restores objects which were originally hidden from parser of MW and completes the page in html format.

It was not that easy for me either, I had to test it back and forth quite a long time before I found the reason to this problem. It seems that external link is broken into different elements in call of "parent::internalParse" and then rebuilt again: html characters are encoded when link has been rebuilt in "parent::internalParse->replaceExternalLinks" on line where "$s .= Linker::makeExternalLink....".

Inserted new function call "$this->htmlDecode(...)" in "CKeditorParser.body.php" is now canceling this encoding. Disadvantage is that it will cancel encodings everywhere on page so that is why I am little unsure how valid this fix is.... but we can worry this later, in case it causes problems :).