src/Blocks/Image.cs
/// <summary>
/// Writes the block to the given TextWriter.
/// </summary>
/// <param name="writer">writer</param>
/// <param name="formatting">optional formatting</param>
Writes the block to the given TextWriter.
Writes the block to the given TextWriter .
public override void Write(TextWriter writer, MarkdownFormatting formatting)
        {
            string altText = (AltText ?? "").Replace("\n", " ").Replace("\r", "").Trim();
            string description = (Description??"").Replace("\n", " ").Replace("\r", "").Trim();
            writer.Write(Indent);
            writer.Write($"![{altText}]({ImagePath}");
            if (!string.IsNullOrWhiteSpace(description))
                writer.Write($" \"{description}\"");
            writer.WriteLine(")");
            writer.WriteLine();
        }
public override void Write ( TextWriter writer , MarkdownFormatting formatting ) { string altText = ( AltText ?? " " ) . Replace ( " \n " , " " ) . Replace ( " \r " , " " ) . Trim ( ) ; string description = ( Description ?? " " ) . Replace ( " \n " , " " ) . Replace ( " \r " , " " ) . Trim ( ) ; writer . Write ( Indent ) ; writer . Write ( $" ![ { altText } ]( { ImagePath } " ) ; if ( ! string . IsNullOrWhiteSpace ( description ) ) writer . Write ( $" \" { description } \" " ) ; writer . WriteLine ( " " ) ; writer . WriteLine ( ) ; }
Writes the block to the given TextWriter.
Writes the block to the given TextWriter .
writer
TextWriter
None
formatting
MarkdownFormatting
None