Refactor namespace normalization into Util function

Addresses Bug 53187
Chose not to provide non-normalized namespace getter/setter methods to WikiConfig
object in order to preserve encapsulation.

Change-Id: I68a45911ec4c5324b006e3c72240f555fff1ec76
Add DOM support for {{DISPLAYTITLE}}

Bug: 56870
Change-Id: I9bb80b0116db623574c8806d44d74d68a3a685e9
Clean up a bit around domHandlers

Change-Id: If1e4cce5d0abe0b719e0d74190198eada13c3556
Merge "Clean up a bit around domHandlers"
Rename page property to displaytitle

 * Follows up on 8f6103b362fce6f24506febb707e59091273e145.

Bug: 56870
Change-Id: Iba2fff95080eb5c69de0ca54b7f0a6ded643b4f4
Minor cleanup in paragraphWrapper

 * The call to closeOpenPTag is redundant because it already happens in
   processPendingNLs for blockTokens.

Change-Id: Ie2a86164f57f0ded488f4c92c51da97e7cae1732
Merge "Minor cleanup in paragraphWrapper"
Always pass in node when escaping content string

Change-Id: I3d7950104850c8fcc03eb19f468c511af21b0cf5
Merge "Refactor namespace normalization into Util function"
Merge "Always pass in node when escaping content string"
Pin html5 to 0.3.15 since 0.3.16 seems to be buggy.

* Based on IRC reports by Inez couple weeks back, we found out that
  cardfight.wikia.com:Embodiment_of_Armor,_Bahr?oldid=1148775
  would crash with the 0.3.16 version of html5.

* So, for now, pin html5 library to the exact version.

Change-Id: Iab2cb99b4190f1a9a68eb67ea2dff86b690b38f7
WTS: Post-processing to remove unnecessary indent-pre nowikis

* WTS doesn't have enough context to suppress unnecessary indent-pre
  nowikis. Ex: lines that have a block tag on it.

* This patch adds a post-processing pass that strips such nowikis
  where it can safely determine that indent-pre nowikis will
  get suppressed.

* The pass is only run if indent-pre nowikis have been added in the
  first place. So, this doesn't affect the common case where nowikis
  aren't added.

* Eliminates an unnecessary <nowiki> in a blacklisted selser test
  and improves its accuracy.

Change-Id: I6da350ac76c208cb07b26b8ecbfe80654691a512
WTS: Improved consistency + bug fixes handling whitespace in text nodes.

* Now, all leading whitespace is stripped from a text node and
  made part of separator text before it since separator handling
  has a lot more intelligence dealing with indent-pres and the
  nowiki-escaping algorithm doesn't.

  Ex: <ul><li>\n foo</li></ul>

  Here, the leading whitespace on a newline in "\n foo" does not
  lead to indent-pres and doesn't need nowiki escaping because
  <li> is a strong indent-pre suppressing node.

* ZeroWikitextWidthNode information was not checking if the node
  is a literal HTML node. Fixe this by adding a helper method in
  DOMUtils and using the helper.

* Fixed a bug in DU.precedingSpaceSuppressesIndentPre to skip over
  the node that contributed separator text.

* <P> is also a strong-indent-pre suppressing tag. Check this in a
  sandbox: "<p>\n  foo\n<p>\n\n<p>\n  <span>\n   bar\n</span>\n</p>"

* Given the A-B node pair, makeSepIndentPre was mixing up notions of
  indent-pre suppression (induced by nodeA and which affects nowiki
  wrapping) and sensitivity to space chars in sol-position (applies
  to nodeB and requires whitespace stripping). This patch separates
  those notions and fixes things up.

* After all these bug fixes:
  - one blacklisted selser test now green.
    (because non-selser output improved and matched selser).
  - output of previously blacklisted tests changed.
    The change makes sense. The first nowiki is to suppress indent-pre
    on the first line. The second nowiki is to suppres indent-pre and
    <td> rendering for the | char on the second line.

Change-Id: Id6edbc0b0804995c02ce61a9e1ba52d63af58e91
Strip unsupported table tags when serializing

Bug: 66341
Change-Id: I9b8636bcbaa4443da94b71a96b59688cb1d85a3c
Nowiki wrap new text w/ pre|post-apost. adjacent to i|b

 * When an apostrophe is added to the beginning or end of a text-node
   next to an italic or bold element, it can serialize to unintended
   semantics. Ex.

     <p>New text goes'<i>here</i></p>

         --> New text goes'''here''
     now --> <nowiki>New text goes'</nowiki>''here''

 * The newly failing selser tests are precisely these scenarios.

Bug: 52784
Change-Id: I02087c217da2ab4fc113d336d689a657275cb834
Merge "WTS: Post-processing to remove unnecessary indent-pre nowikis"
Avoid a replace

 * Maybe an improvement on 37fbccb41dc0160af2232da727fbb898a1920205.

 * Sorry, this should have been mentioned in review :(

Change-Id: Ie98d62d122c363b043b67baee53d7a664ba30a03
Merge "WTS: Improved consistency + bug fixes handling whitespace in text nodes."
Merge "Avoid a replace"
Merge "Nowiki wrap new text w/ pre|post-apost. adjacent to i|b"