Ejemplo n.º 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;
 }
Ejemplo n.º 2
0
        public void Serializer_respects_EmphasisStyle_serialization_option(MdEmphasisStyle emphasisStyle, char emphasisCharater)
        {
            var options = new MdSerializationOptions()
            {
                EmphasisStyle = emphasisStyle
            };

            AssertToStringEquals(
                $"# {emphasisCharater}Heading{emphasisCharater}\r\n",
                new MdDocument(
                    new MdHeading(1, new MdEmphasisSpan("Heading"))),
                options
                );
        }
Ejemplo n.º 3
0
        public void ToString_respects_EmphasisStyle_from_serialization_options(MdEmphasisStyle emphasisStyle, char emphasisCharater)
        {
            var text = "Some text";
            var span = new MdEmphasisSpan(text);

            var options = new MdSerializationOptions()
            {
                EmphasisStyle = emphasisStyle
            };

            var expected = $"{emphasisCharater}{text}{emphasisCharater}";
            var actual   = span.ToString(options);

            Assert.Equal(expected, actual);
        }