src/Inlines/ItalicText.cs
/// <summary>
/// Writes the text as markdown.
/// </summary>
/// <param name="writer">Text writer to write object to</param>
/// <param name="formatting">Optional formatting information</param>
Writes the text as markdown.
Writes the text as markdown .
public override void Write(TextWriter writer, MarkdownFormatting formatting)
        {
            char emphasis = formatting?.UseAsterisksForEmphasis == true ? '*' : '_';
            if (Text.Contains(emphasis))
                emphasis = emphasis == '*' ? '_' : '*';
            var sw = new StringWriter();
            base.Write(sw, formatting);
            writer.Write(emphasis);
            writer.Write(sw.ToString());
            writer.Write(emphasis);
        }
public override void Write ( TextWriter writer , MarkdownFormatting formatting ) { char emphasis = formatting ? . UseAsterisksForEmphasis == true ? ' ' : ' ' ; if ( Text . Contains ( emphasis ) ) emphasis = emphasis == ' ' ? ' ' : ' ' ; var sw = new StringWriter ( ) ; base . Write ( sw , formatting ) ; writer . Write ( emphasis ) ; writer . Write ( sw . ToString ( ) ) ; writer . Write ( emphasis ) ; }
Writes the text as markdown.
Writes the text as markdown .
writer
TextWriter
Text writer to write object to
Text writer to write object to
formatting
MarkdownFormatting
Optional formatting information
Optional formatting information