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

[Fix] Nickel doc: fix missing newline in markdown output #1880

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

yannham
Copy link
Member

@yannham yannham commented Apr 3, 2024

#1879 fixed nickel doc markdown output having spurious backslashes (#1706). However, #1879 also re-introduced a previous issue - which was why the removed hard line breaks was introduced in the first place - which is that the list of types and contracts of a field and the custom documentation might be squashed together because the renderer wouldn't properly insert a newline after the generated list (#1520).

After some investigation, it seems to be a bug in the comrak renderer. However, this bug doesn't show when the markdown is parsed from an actual source (instead of being programmatically generated). It turns out comrak correctly inserting this required newline relies on the unspoken assumption that every markdown list item content is wrapped as a paragraph. This commit thus fixes the issue by inserting the missing paragraph wrapper.

A recent commit fixed the `nickel doc` markdown output having spurious
backslashes introduced. However, it also re-introduced a previous issue
- which was why the problematic hard line breaks were introduced in the
first place - which is that the list of types and contracts of a field
and the custom documentation might be squashed together because the
renderer wouldn't properly insert a newline after the generated list.

After some investigation, it seems to be a bug in the comrak renderer.
However, this bug doesn't show when the markdown is parsed from an
actual source (instead of being programmatically generated). It turns
out comrak correctly inserting this required newline relies on the
unspoken assumption that every markdown list item content is wrapped as
a paragraph. This commit thus fixes the issue by inserting the missing
paragraph wrapper.
@yannham yannham requested review from jneem and vkleen April 3, 2024 17:11
@github-actions github-actions bot temporarily deployed to pull request April 3, 2024 17:14 Inactive
@yannham yannham added this pull request to the merge queue Apr 3, 2024
Merged via the queue into master with commit 6e79f0d Apr 3, 2024
5 checks passed
@yannham yannham deleted the fix/doc-missing-newline branch April 3, 2024 21:07
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