Skip to content

[Bug] Trim of indentation on external <code> #9462

@rapmue

Description

@rapmue

Describe the bug

When referencing code from within xmldoc comments like:

/// <summary>
/// Interface for a program processor.
/// </summary>
/// <example><code source="../../../SDK.Examples/CustomProcessorExample.cs" region="SDK_CustomProcessor" /></example>

it will be rendered with indentation, but the code has no indentation.

image

image

To Reproduce
Steps to reproduce the behavior:

  1. include an example code from external source
  2. the external source code should be in the right place
  3. generate the metadata and build the documentation

Expected behavior
The expected behaviour is to have the indentation stay the same as in the file, respective region which is included.

Context:

  • OS: Windows
  • Docfx version: [e.g. 2.73.0]
  • modern template
  • markdig engine

Additional context

excempt of docfx.json

"template": [
          "default",
	  "modern"
    ],
    "postProcessors": [],
    "markdownEngineName": "markdig",

Originally posted by @rapmue in #6440 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    dotnet: xml-commentXML comment for .NET API reference docs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions