Skip to content

Preserve blank lines in endpoint descriptions#1068

Merged
david-crespo merged 2 commits into
mainfrom
doc-comment-newlines
Jul 25, 2024
Merged

Preserve blank lines in endpoint descriptions#1068
david-crespo merged 2 commits into
mainfrom
doc-comment-newlines

Conversation

@david-crespo

Copy link
Copy Markdown
Contributor

Currently we turn blank lines in a doc comment into a single \n. When we then try to treat that text as markdown (e.g., on the docs site), markdown ignores single blank lines. This is the difference between this

image

and this

image

So here we keep those blank lines as a double \n\n.

@david-crespo david-crespo requested review from ahl and sunshowers July 24, 2024 22:14
@david-crespo

Copy link
Copy Markdown
Contributor Author

Tagging you @sunshowers for fun since we just talked about an unrelated doc comment parsing issue here.

@david-crespo david-crespo changed the title Preserve blank lines in doc comments Preserve blank lines in endpoint descriptions Jul 24, 2024
@david-crespo

Copy link
Copy Markdown
Contributor Author

I regenerated the Nexus OpenAPI JSON using this code and confirmed the comment I added in oxidecomputer/omicron#5914 is the only one affected by this change.

Comment thread dropshot_endpoint/src/doc.rs

@sunshowers sunshowers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Though I'm not sure if Adam or Dave also want to have a look at it.

@david-crespo

Copy link
Copy Markdown
Contributor Author

Considering the effect in Nexus is so limited, I’m just gonna go for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants