Skip to content

Codemaid removing whitespaces on XML Comments inside <code> tags #875

Open
@Ksdmg

Description

@Ksdmg

Environment

  • Visual Studio version: 2019 Professional
  • CodeMaid version: 12.0
  • Code language: c#

Description

Codemaid is removing leading whitespaces when providing code examples in XML comments.

Steps to recreate

Add an XML comment with code example:

    /// <summary>
    /// Implementation of <see cref="INotifyPropertyChanged"/> to simplify models.
    /// <code>
    /// this.PropertyChanged?.Invoke(this, args);
    /// </code>
    /// </summary>
    /// <example>
    public class BindableBase : INotifyPropertyChanged

Current behavior

I have Codemaid automatic cleanup on document save enabled. This removes leading whitespaces on code examples. This is especially annoying when providing longer code examples.

    /// <summary>
    /// Implementation of <see cref="INotifyPropertyChanged"/> to simplify models.
    /// <code>
    ///this.PropertyChanged?.Invoke(this, args);
    /// </code>
    /// </summary>
    /// <example>
    public class BindableBase : INotifyPropertyChanged

Expected behavior

Codemaid should retain a leading whitespaces to show intendation on code.

    /// <summary>
    /// Implementation of <see cref="INotifyPropertyChanged"/> to simplify models.
    /// <code>
    /// this.PropertyChanged?.Invoke(this, args);
    /// </code>
    /// </summary>
    /// <example>
    public class BindableBase : INotifyPropertyChanged

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions