anchor.diff:  /// SETEXT should win.
   final _hrPattern = new RegExp(r'^ {0,3}([-*_]) *\1 *\1(?:\1| )*$');
   
  -/// Really hacky way to detect block-level embedded HTML. Just looks for
  -/// "<somename".
  -final _htmlPattern = new RegExp(r'^<[ ]*\w+[ >]');
  -
   /// A line starting with one of these markers: `-`, `*`, `+`. May have up to
   /// three leading spaces before the marker and any number of spaces or tabs
   /// after.
  
positive.code: /// implementations in several ways:
  ///
  /// 1.  This one is way way WAY simpler.
  /// 2.  All HTML tags at the block level will be treated as blocks. If you
  ///     start a paragraph with `<em>`, it will not wrap it in a `<p>` for you.
  ///     As soon as it sees something like HTML, it stops mucking with it until
  ///     it hits the next block.
  /// 3.  Absolutely no HTML parsing or validation is done. We're a Markdown
  ///     parser, not an HTML parser!
  class BlockHtmlSyntax extends BlockSyntax {
    RegExp get pattern => _htmlPattern;
  
    bool get canEndBlock => false;
  
    const BlockHtmlSyntax();
  
    Node parse(BlockParser parser) {
      var childLines = <String>[];
  
negative.code:       parser.advance();
      }
  
      return new Text(childLines.join('\n'));
    }
  }
  
  class OtherTagBlockHtmlSyntax extends BlockTagBlockHtmlSyntax {
    bool get canEndBlock => false;
  
    // Really hacky way to detect "other" HTML. This matches:
    //
    // * any opening spaces
    // * open bracket and maybe a slash ("<" or "</")
    // * some word characters
    // * either:
    //   * a close bracket, or
    //   * whitespace followed by not-brackets follwed by a close bracket
    // * possible whitespace and the end of the line.
    RegExp get pattern => new RegExp(r'^ {0,3}</?\w+(?:>|\s+[^>]*>)\s*$');
  
    const OtherTagBlockHtmlSyntax();
  }
  
  /// A BlockHtmlSyntax that has a specific [endPattern].
  ///
  /// In practice this means that the syntax dominates; it is allowed to eat
  /// many lines, including blank lines, before matching its [endPattern].
  class LongBlockHtmlSyntax extends BlockHtmlSyntax {
    RegExp _pattern;
    RegExp _endPattern;
  
    LongBlockHtmlSyntax(pattern, endPattern) {
      _pattern = new RegExp(pattern);
      _endPattern = new RegExp(endPattern);
    }
  
    RegExp get pattern => _pattern;
  
    Node parse(BlockParser parser) {
      var childLines = <String>[];
      // Eat until we hit [endPattern].
      while (!parser.isDone) {
        childLines.add(parser.current);
        if (parser.matches(_endPattern)) break;
        parser.advance();
      }
  
      parser.advance();
      return new Text(childLines.join('\n'));
    }
  }
  