src/Inlines/InlineLink.cs
/// <summary>
/// Write the Markdown for this inline link
/// </summary>
/// <param name="writer"></param>
/// <param name="formatting"></param>
Write the Markdown for this inline link
Write the Markdown for this inline link
public override void Write(TextWriter writer, MarkdownFormatting formatting)
        {
            if (!Bold && !Italic && !Code && string.IsNullOrEmpty(Title)
                && Text == Url && GetType() == typeof(InlineLink))
            {
                writer.Write($"<{Url}>");
                return;
            }
            writer.Write("[");
            if (!string.IsNullOrEmpty(Text))
            {
                if (Bold) writer.Write("**");
                if (Italic) writer.Write("*");
                if (Code) writer.Write("`");
                writer.Write(Text);
                if (Code) writer.Write("`");
                if (Italic) writer.Write("*");
                if (Bold) writer.Write("**");
            }
            writer.Write($"]({Url}");
            if (!string.IsNullOrWhiteSpace(Title))
                writer.Write(" \"" + Title + "\"");
            writer.Write(")");
        }
public override void Write ( TextWriter writer , MarkdownFormatting formatting ) { if ( ! Bold && ! Italic && ! Code && string . IsNullOrEmpty ( Title ) && Text == Url && GetType ( ) == typeof ( InlineLink ) ) { writer . Write ( $" < { Url } > " ) ; return ; } writer . Write ( " " ) ; if ( ! string . IsNullOrEmpty ( Text ) ) { if ( Bold ) writer . Write ( " " ) ; if ( Italic ) writer . Write ( " " ) ; if ( Code ) writer . Write ( " " ) ; writer . Write ( Text ) ; if ( Code ) writer . Write ( " " ) ; if ( Italic ) writer . Write ( " " ) ; if ( Bold ) writer . Write ( " " ) ; } writer . Write ( $" ]( { Url } " ) ; if ( ! string . IsNullOrWhiteSpace ( Title ) ) writer . Write ( " \" " + Title + " \" " ) ; writer . Write ( " " ) ; }
Write the Markdown for this inline link
Write the Markdown for this inline link
// Output simplified URL format if URL is the same as the text if this is an inline link.
writer
TextWriter
None
formatting
MarkdownFormatting
None