Several improvements + bug fixes to quote nowiki stripping algo

* This now handles html/extension tags. This is required because quotes
  and <ref>..</ref> tags show up on the same line quite commonly.

* The code now only strips one <nowiki/> per line, and specifically the
  last <nowiki/> it can strip. In the bargain, several other constraints
  in the old algo got relaxed which leads to improvement to <nowiki/>
  stripping in tests.

* There are 2 scenarios where non-selser and selser serializer differ:
  - Since the nowiki stripping algo only strips a single <nowiki/> per line
    (safe but conservative assumption), selser may encounter a single
    nowiki on a line and strip it, but non-selser may see 2 or more and
    strip one and leave the rest behind.

  - Since the stripping is activated only when a nowiki is actually
    emitted during escaping, selser may never set this flag and hence
    the nowiki stripping algo may not run in selser mode. So, it can
    happen that non-selser wts can remove a <nowiki/> from a line
    post-edits whereas selser faithfuly preserves an unneeded nowiki.
    This shortcoming in selser mode will be addressed in a later patch.

Co-authored by: C. Scott Ananian <cscott@cscott.net>
Change-Id: I5e565dec59d4cadca327403f63be84258e88b632
Merge "Several improvements + bug fixes to quote nowiki stripping algo"