Revert "Fixes dart-lang/markdowndart-lang/markdown#86." This change breaks the CommonMark tests
diff --git a/pkgs/markdown/lib/src/html_renderer.dart b/pkgs/markdown/lib/src/html_renderer.dart index 03977ca..184f9f9 100644 --- a/pkgs/markdown/lib/src/html_renderer.dart +++ b/pkgs/markdown/lib/src/html_renderer.dart
@@ -85,11 +85,6 @@ if (element.isEmpty) { // Empty element like <hr/>. buffer.write(' />'); - - if (element.tag == 'br') { - buffer.write('\n'); - } - return false; } else { buffer.write('>');
diff --git a/pkgs/markdown/lib/src/inline_parser.dart b/pkgs/markdown/lib/src/inline_parser.dart index 6a70cc1..9be8704 100644 --- a/pkgs/markdown/lib/src/inline_parser.dart +++ b/pkgs/markdown/lib/src/inline_parser.dart
@@ -14,7 +14,6 @@ static final List<InlineSyntax> _defaultSyntaxes = new List<InlineSyntax>.unmodifiable(<InlineSyntax>[ new AutolinkSyntax(), - new LineBreakSyntax(), new LinkSyntax(), new ImageSyntax(), // Allow any punctuation to be escaped. @@ -30,6 +29,10 @@ new TextSyntax(r'&', sub: '&'), // Encode "<". (Why not encode ">" too? Gruber is toying with us.) new TextSyntax(r'<', sub: '<'), + // Escaped newlines become hard line breaks. + new TextSyntax(r'\\\n', sub: '<br />\n'), + // Two or more spaces at the end of a line become hard line breaks. + new TextSyntax(r' +\n', sub: '<br />\n'), // Parse "**strong**" tags. new TagSyntax(r'\*\*', tag: 'strong'), // Parse "__strong__" tags. @@ -188,17 +191,6 @@ bool onMatch(InlineParser parser, Match match); } -/// Represents a hard line break. -class LineBreakSyntax extends InlineSyntax { - LineBreakSyntax() : super(r'(?:\\| +)\n'); - - /// Create a void <br> element. - bool onMatch(InlineParser parser, Match match) { - parser.addNode(new Element.empty('br')); - return true; - } -} - /// Matches stuff that should just be passed through as straight text. class TextSyntax extends InlineSyntax { final String substitute;