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]: Put <details> into remarks with <code>, the display of content is looks strange #3069

Open
Flithor opened this issue Sep 12, 2024 · 0 comments
Labels
bug help-wanted A change up for grabs for contributions from the community

Comments

@Flithor
Copy link

Flithor commented Sep 12, 2024

Describe the bug

the example api documentation

/// <summary>My work api</summary>
/// <remarks>
/// <details>
/// <summary>Details Title</summary>
/// <code>
/// {
///  "Prop1":1,
///  "Prop2":[]
/// }
/// </code>
/// </details>
/// </remarks>

And I got this:
image
ther part in json is this:

"description": "<details>\r\n  <summary>Details Title</summary>\r\n  ```\r\n            {\r\n             \"Prop1\":1,\r\n             \"Prop2\":[]\r\n            }\r\n            ```\r\n</details>"

Test OpenApi on swagger-ui test see here: swagger-api/swagger-ui#4977 (comment)

The workaround:

Put some text before <details>, and add <br/> before and after <code>...</code>

/// <summary>My work api</summary>
/// <remarks>
/// You need put some text before "details" tag can reomve the long space string in output
/// <details>
/// <summary>Details Title</summary><br/>
/// <code>
/// {
///  "Prop1":1,
///  "Prop2":[]
/// }
/// </code><br/>
/// </details>
/// </remarks>

And looks fine:
image

@Flithor Flithor added the bug label Sep 12, 2024
@Flithor Flithor changed the title [Bug]: Put <details> into remark and with <code> content make strange display [Bug]: Put <details> into remarks with <code>, the display content has strange display Sep 12, 2024
@Flithor Flithor changed the title [Bug]: Put <details> into remarks with <code>, the display content has strange display [Bug]: Put <details> into remarks with <code>, the display of content is looks strange Sep 12, 2024
@martincostello martincostello added the help-wanted A change up for grabs for contributions from the community label Sep 12, 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