Skip to content

[Bug] Doc comment's <code> block is not correctly rendered when another tags exists before <code> tag #10385

@filzrev

Description

@filzrev

Describe the bug

When <para></para> tag exists before <code> tag,
Rendered HTML results is corrupted.

Example documentation comment

/// <remarks>
/// <para>
/// Dummy paragraph.
/// </para>
/// <code lang="cs">
/// public sealed class Sample
/// {
///     public int AAA {get;set;}
///
///     public int BBB {get;set;}
///
///     public int CCC {get;set;}
/// }
/// </code>
/// </remarks>
public class Sample
{
    public int Dummy { get; set; }
}

Rendered Image
Image

To Reproduce

  1. Set documentation comment described above.
  2. Run docfx metadata command
  3. Run docfx build --serve command
  4. Confirm API page for Sample class

Expected behavior
<code></code> blocks are rendered as expected.

Additional context
To resolve this issue.
It need to add extra new line before <pre> tag.
That is required when embedding HTML tags on markdown text.

See https://github.com/xoofx/markdig/issues/472#issuecomment-683787240 for details

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions