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

scripts/managen: fix parsing of markdown code sections #16345

Closed
wants to merge 1 commit into from

Conversation

jay
Copy link
Member

@jay jay commented Feb 16, 2025

  • Terminate a code section before parsing a heading line.

Prior to this change when a code line (eg code) was followed
by a heading line (eg ## heading) the code section in the output
was terminated after converting the header instead of before. That led
to some weird formatting outputs depending on the nroff or roffit etc.

With this change:

.nf
curl \--expand\-url https.//example.com/{{url:trim}}
.fi
.IP json

Without this change:

.nf
curl \--expand\-url https.//example.com/{{url:trim}}
.IP json
.fi

Closes #xxxx


There is bad formatting in the curl man page website version

bad_pre_format

I traced at least part of the problem back to managen and fixed it in managen's nroff formatted output but I'm not sure about the webpage generation so more changes may be needed after this. (update: more changes were not needed)

- Terminate a code section before parsing a heading line.

Prior to this change when a code line (eg "    code") was followed
by a heading line (eg "## heading") the code section in the output
was terminated after converting the header instead of before. That led
to some weird formatting outputs depending on the nroff or roffit etc.

With this change:

.nf
curl \--expand\-url https.//example.com/{{url:trim}}
.fi
.IP json

Without this change:

.nf
curl \--expand\-url https.//example.com/{{url:trim}}
.IP json
.fi

Closes #xxxx
@jay jay added the script label Feb 16, 2025
@jay jay closed this in 28d3c5d Feb 16, 2025
@jay jay deleted the managen_code_formatting branch February 16, 2025 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants