Exemple #1
0
 public MarkdownBuilder Append(string value, EmphasisOptions options, bool escape)
 {
     AppendDelimiter(options);
     Append(value, escape);
     AppendDelimiter(options);
     return(this);
 }
Exemple #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);
            }
        }
Exemple #3
0
 public MarkdownBuilder Append(string value, EmphasisOptions options)
 {
     return(Append(value, options, escape: true));
 }
 internal MarkdownText(string text, EmphasisOptions options, bool escape)
 {
     Text    = text;
     Options = options;
     Escape  = escape;
 }
Exemple #5
0
 public static MarkdownText Text(string value, EmphasisOptions options = EmphasisOptions.None)
 {
     return(new MarkdownText(value, options, escape: true));
 }