Accept pre-like strings without crashing

 * Adds a new parser test (PHP output differs) from Subbu's abandoned
   patch: https://gerrit.wikimedia.org/r/#/c/133483

Bug: 64025
Change-Id: I079571dcabf19642a62cbb08e951545af7b95dff