public static string ToStringAndClear(this MarkdownWriter mb) { string s = mb.ToString(); ((MarkdownStringWriter)mb).GetStringBuilder().Clear(); return(s); }
public static void TestTableHeaderWithTwoCharacter() { using (MarkdownWriter mw = MarkdownWriter.Create(new StringBuilder())) { mw.WriteLine(); mw.WriteStartTable(3); mw.WriteStartTableRow(); mw.WriteStartTableCell(); mw.WriteString(" "); mw.WriteEndTableCell(); mw.WriteStartTableCell(); mw.WriteString("aa"); mw.WriteEndTableCell(); mw.WriteStartTableCell(); mw.WriteString("bb"); mw.WriteEndTableCell(); mw.WriteEndTableRow(); mw.WriteTableHeaderSeparator(); mw.WriteStartTableRow(); mw.WriteStartTableCell(); mw.WriteString(" "); mw.WriteEndTableCell(); mw.WriteStartTableCell(); mw.WriteString("c"); mw.WriteEndTableCell(); mw.WriteStartTableCell(); mw.WriteString("d"); mw.WriteEndTableCell(); mw.WriteEndTableRow(); mw.WriteEndTable(); Assert.Equal( @" | | aa | bb | | --- | --- | --- | | | c | d | ", mw.ToString()); } }
public override string ToString() { return(_writer.ToString()); }