예제 #1
0
 public MarkdownBuilder Append(string value, EmphasisOptions options, bool escape)
 {
     AppendDelimiter(options);
     Append(value, escape);
     AppendDelimiter(options);
     return(this);
 }
예제 #2
0
        public void AppendDelimiter(EmphasisOptions options)
        {
            if (options == EmphasisOptions.None)
            {
                return;
            }

            if ((options & EmphasisOptions.Bold) != 0)
            {
                Append(BoldDelimiter);

                if ((options & EmphasisOptions.Italic) != 0)
                {
                    Append(AlternativeItalicDelimiter);
                }
            }
            else if ((options & EmphasisOptions.Italic) != 0)
            {
                Append(ItalicDelimiter);
            }

            if ((options & EmphasisOptions.Strikethrough) != 0)
            {
                Append(StrikethroughDelimiter);
            }

            if ((options & EmphasisOptions.Code) != 0)
            {
                Append(CodeDelimiter);
            }
        }
예제 #3
0
 public MarkdownBuilder Append(string value, EmphasisOptions options)
 {
     return(Append(value, options, escape: true));
 }
예제 #4
0
 internal MarkdownText(string text, EmphasisOptions options, bool escape)
 {
     Text    = text;
     Options = options;
     Escape  = escape;
 }
예제 #5
0
 public static MarkdownText Text(string value, EmphasisOptions options = EmphasisOptions.None)
 {
     return(new MarkdownText(value, options, escape: true));
 }