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

New lines in description create incorrect markdown #2700

Closed
alexec opened this issue Jan 24, 2022 · 2 comments · Fixed by #3044
Closed

New lines in description create incorrect markdown #2700

alexec opened this issue Jan 24, 2022 · 2 comments · Fixed by #3044

Comments

@alexec
Copy link

alexec commented Jan 24, 2022

Problem statement

Converting a swagger.yaml file to swagger.md create incorrect markdown, because the new lines are not remove/escaped (or what ever is needed).

argoproj/argo-workflows#7615

Swagger specification

Steps to reproduce

Environment

swagger version: v0.29.0
go version: 1.17
OS: MacOS

@fredbi
Copy link
Contributor

fredbi commented Jan 4, 2024

Rewriting new lines with
seems to be a popular markdown tip:

Filesystem type of the volume that you want to mount.

Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore

Using block quote alters the rendering, so this is probably not what we want.

Filesystem type of the volume that you want to mount.
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore

@fredbi
Copy link
Contributor

fredbi commented Jan 4, 2024

Provided example would render like so:

Properties

Name Type Go type Required Default Description Example
fsType interface{} interface{} Filesystem type of the volume that you want to mount.
Tip: Ensure that the filesystem type is supported by the host operating system.
Examples: "ext4", "xfs", "ntfs". Implicitly inferred to be "ext4" if unspecified.
More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore

TODO: how do we prevent errors in the filesystem from compromising the machine

fredbi added a commit to fredbi/go-swagger that referenced this issue Jan 4, 2024
* fixes go-swagger#2700

This PR introduces a new template function to replace new lines (or
carriage returns) in descriptions by "</br>" tags in the generated
markdown.

I could verify that this renders correctly on github markdown.

Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
fredbi added a commit to fredbi/go-swagger that referenced this issue Jan 6, 2024
* fixes go-swagger#2700

This PR introduces a new template function to replace new lines (or
carriage returns) in descriptions by "</br>" tags in the generated
markdown.

I could verify that this renders correctly on github markdown.

Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
fredbi added a commit that referenced this issue Jan 6, 2024
* fixes #2700

This PR introduces a new template function to replace new lines (or
carriage returns) in descriptions by "</br>" tags in the generated
markdown.

I could verify that this renders correctly on github markdown.

Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants