public static string ToStringAndClear(this MarkdownWriter mb)
        {
            string s = mb.ToString();

            ((MarkdownStringWriter)mb).GetStringBuilder().Clear();
            return(s);
        }
Esempio n. 2
0
        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());
            }
        }
Esempio n. 3
0
 public override string ToString()
 {
     return(_writer.ToString());
 }