To reproduce, enter Some text [[Some page|Alias more text in a form's free text field and submit.
JavaScript will hang at the loop starting at line 797 in libs/PageForms.js.
When nextDoubleBracketsEnd are set to -1, and then curIndex = nextDoubleBracketsEnd + 2, i.e., 1, the loop becomes endless.
It seems that the check if ( nextDoubleBracketsEnd < 0 ) should be placed elsewhere, or the whole check for pipes not inside double square brackets rewritten.