예제 #1
0
 private MdSerializationOptions(
     bool isReadOnly,
     MdEmphasisStyle emphasisStyle           = MdEmphasisStyle.Asterisk,
     MdThematicBreakStyle thematicBreakStyle = MdThematicBreakStyle.Underscore,
     MdHeadingStyle headingStyle             = MdHeadingStyle.Atx,
     MdCodeBlockStyle codeBlockStyle         = MdCodeBlockStyle.Backtick,
     MdBulletListStyle bulletListStyle       = MdBulletListStyle.Dash,
     MdOrderedListStyle orderedListStyle     = MdOrderedListStyle.Dot,
     int minimumListIndentationWidth         = 2,
     MdTableStyle tableStyle      = MdTableStyle.GFM,
     int maxLineLength            = -1,
     ITextFormatter?textFormatter = null)
 {
     m_IsReadOnly                  = isReadOnly;
     m_EmphasisStyle               = emphasisStyle;
     m_ThematicBreakStyle          = thematicBreakStyle;
     m_HeadingStyle                = headingStyle;
     m_CodeBlockStyle              = codeBlockStyle;
     m_BulletListStyle             = bulletListStyle;
     m_OrderedListStyle            = orderedListStyle;
     m_MinimumListIndentationWidth = minimumListIndentationWidth;
     m_TableStyle                  = tableStyle;
     m_MaxLineLength               = maxLineLength;
     m_TextFormatter               = textFormatter ?? DefaultTextFormatter.Instance;
 }
예제 #2
0
        public void Serializer_respects_BulletListStyle_serialization_option(MdBulletListStyle style, char listItemCharacter)
        {
            var options = new MdSerializationOptions()
            {
                BulletListStyle = style
            };

            AssertToStringEquals(
                $"{listItemCharacter} Item1\r\n" +
                $"{listItemCharacter} Item2\r\n",
                new MdDocument(
                    new MdBulletList(
                        new MdListItem("Item1"),
                        new MdListItem("Item2")
                        )
                    ),
                options
                );
        }
예제 #3
0
        public void Serializer_changes_ThematicBreak_style_when_inside_bullet_list_with_a_conflicting_style(MdThematicBreakStyle thematicBreakStyle, char thematicBreakCharacter, MdBulletListStyle bulletListStyle, char bulletListCharacter)
        {
            var options = new MdSerializationOptions()
            {
                BulletListStyle    = bulletListStyle,
                ThematicBreakStyle = thematicBreakStyle
            };

            AssertToStringEquals(
                $"{bulletListCharacter} Item1\r\n" +
                $"\r\n" +
                $"  {thematicBreakCharacter}{thematicBreakCharacter}{thematicBreakCharacter}\r\n",
                new MdDocument(
                    new MdBulletList(
                        new MdListItem(new MdParagraph("Item1"), new MdThematicBreak())
                        )
                    ),
                options
                );
        }