Пример #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_ThematicBreakStyle_serialization_option(MdThematicBreakStyle style, string expectedBreak)
        {
            var options = new MdSerializationOptions()
            {
                ThematicBreakStyle = style
            };

            AssertToStringEquals(
                $"{expectedBreak}\r\n",
                new MdDocument(new MdThematicBreak()),
                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
                );
        }