Correctly parse <indicator/> contents, Parser rejiggering
authorBartosz Dziewoński <matma.rex@gmail.com>
Sun, 2 Nov 2014 18:14:53 +0000 (19:14 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Tue, 4 Nov 2014 10:25:58 +0000 (10:25 +0000)
commit565e9fa077f127449a7141552546e889869fe09a
tree36edb961d14e641b6346e22db1f2523e1b090fa6
parent710c87ba183c684ebb84dba73015e57492c07d7c
Correctly parse <indicator/> contents, Parser rejiggering

includes/parser/Parser.php
  * Pull out a chunk of code we need to reuse from parse() to
    internalParseHalfParsed(). This is a fully backwards-compatible
    change.

    Code changes:
    * Add a guard for running ParserBeforeTidy and ParserAfterTidy
      hooks, as extensions might not expect them to be called for
      snippets, only full page content.
    * Change $options to $this->mOptions.

    The bulk of parsing work is now done in internalParse() and
    internalParseHalfParsed(), parse() only handles four things:
    * Resetting parser state when a parse starts/finishes
    * Page title language conversion
    * Outputting limit report and limitation warnings
    * Running ParserAfterParse hook (dunno why, but it's documented)

  * Expand documentation for recursiveTagParse(), with some uppercase
    warnings so that no one does the stupid thing I did ever again.

  * Add new public method recursiveTagParseFully(), which is a
    recursive parser entry point that produces fully parsed HTML ready
    for inclusion in HTML output. Compared to Parser::parse(), it
    doesn't produce limit reports and doesn't run the ParserAfterParse
    hook.

includes/parser/CoreTagHooks.php
  * Use the new recursiveTagParseFully() method.
  * Use Parser::stripOuterParagraph() to remove silly tags.

Bug: 72887
Change-Id: I89ae9a50b82245f9a9e4a903563aeb1c51b6103e
includes/parser/CoreTagHooks.php
includes/parser/Parser.php