Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rapmue opened this issue Nov 23, 2023 · 1 comment · Fixed by #9465
Closed

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

rapmue opened this issue Nov 23, 2023 · 1 comment · Fixed by #9465
Labels
dotnet: xml-comment XML comment for .NET API reference docs

Comments

@rapmue
Copy link

rapmue commented Nov 23, 2023

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)

@rapmue rapmue changed the title trim of indentation on external <code> [BUG] Trim of indentation on external <code> Nov 23, 2023
@rapmue rapmue changed the title [BUG] Trim of indentation on external <code> [Bug] Trim of indentation on external <code> Nov 23, 2023
@yufeih yufeih added the dotnet: xml-comment XML comment for .NET API reference docs label Nov 24, 2023
@yufeih
Copy link
Contributor

yufeih commented Nov 24, 2023

There seems to be a problem handing intention when the <code> tag immediately follows <example> tag. As a workaround, this would work:

<example>
  <code ... />
</example>

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet: xml-comment XML comment for .NET API reference docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants