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]: Multi-line paragraphs render as pre code html tag pair #3009

Open
rcollette opened this issue Aug 6, 2024 · 0 comments
Open

[Bug]: Multi-line paragraphs render as pre code html tag pair #3009

rcollette opened this issue Aug 6, 2024 · 0 comments
Labels
bug help-wanted A change up for grabs for contributions from the community

Comments

@rcollette
Copy link

rcollette commented Aug 6, 2024

Describe the bug

Given XML comments like

    /// <remarks>
    ///     <para>
    ///         If the user already exists, returns an HTTP 409 and the existing user profile. If the
    ///         user cannot be created due the email domain being on the block list, an HTTP 406 is returned.  If the user
    ///         cannot be created because the email domain cannot be legally processed (ex. OFAC compliance), then an HTTP 451
    ///         code is returned
    ///     </para>
    ///     <para>
    ///         If the user is in the STAGED or PROVISIONED state, and the user's mail domain is NOT federated to an external
    ///         identity provider (ex. by SAML), the Activation property along with its contained ActivationUrl property will
    ///         be set.  The ActivationUrl may be included as a link in a "Welcome" email to the user.  When the user navigates
    ///         to that URL, they will be asked to set their password.
    ///         **The client application should append a fromURI query string parameter (case-sensitive)**,
    ///         which will cause the user to be redirected to an appropriate page, after setting their
    ///         password.
    ///     </para>
    ///     <para>
    ///         Users associated with federated identity providers do not need to be activated or sent an activation link. The
    ///         user will be activated automatically once authenticated by their identity provider.  The user may be sent an
    ///         email with a URL link that sends them directly to the application.
    ///     </para>
    ///     <para>security group: identity_user_create</para>

When the paragraph is multiple lines and the <para> tag stands on its own line. The paragraph is being rendered as a <pre><code> HTML pair, which I believe is incorrect, since there is a <code> tag for XML comments that should equate to HTML <pre><code> (or perhaps just code).

Aside from the glaring difference in formatting between the paragraphs, markdown such a bold (two stars) does not get rendered in the <pre><code> sections, as shown in this screenshot.

image

Expected behavior

New lines within a <para> tag should not be included in the generated JSON and <para> tags should be represented as \n\r in the generated json. This would provide the expected rendering.

Actual behavior

<para> tags in XML comments are rendering as HTML <pre><code> pairs when the paragraph extends over more than one line.

Steps to reproduce

No response

Exception(s) (if any)

No response

Swashbuckle.AspNetCore version

6.7.0

.NET Version

net8.0

Anything else?

No response

@rcollette rcollette added the bug label Aug 6, 2024
@martincostello martincostello added the help-wanted A change up for grabs for contributions from the community label Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help-wanted A change up for grabs for contributions from the community
Projects
None yet
Development

No branches or pull requests

2 participants