Skip to content

Commit

Permalink
Allow multi-line setext headings
Browse files Browse the repository at this point in the history
  • Loading branch information
Kārlis Gaņģis committed Apr 11, 2016
1 parent 98f1b46 commit df75c9e
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions CommonMark/Parser/BlockMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,6 @@ private static int ParseListMarker(string ln, int pos, out ListData data)
return (pos - startpos);
}

private static bool ContainsSingleLine(StringContent content)
{
if (content == null)
return true;
var i = content.IndexOf('\n');
return (i == -1 || i == content.Length - 1);
}

private static bool ListsMatch(ListData listData, ListData itemData)
{
return (listData.ListType == itemData.ListType &&
Expand Down Expand Up @@ -657,8 +649,7 @@ public static void IncorporateLine(LineInfo line, ref Block curptr)

}
else if (!indented && container.Tag == BlockTag.Paragraph && (curChar == '=' || curChar == '-')
&& 0 != (matched = Scanner.scan_setext_heading_line(ln, first_nonspace, ln.Length))
&& ContainsSingleLine(container.StringContent))
&& 0 != (matched = Scanner.scan_setext_heading_line(ln, first_nonspace, ln.Length)))
{

container.Tag = BlockTag.SetextHeading;
Expand Down

0 comments on commit df75c9e

Please sign in to comment.