馃悰 fix: render list or multi-paragraph help under the option - #354
Merged
Conversation
gaborbernat
force-pushed
the
help-nodes
branch
6 times, most recently
from
August 27, 2026 16:24
107041a to
eb0ff9d
Compare
Whitespace-only help crashed with IndexError because nested_parse returned no nodes and the code indexed the first one. Help that parsed to a bullet list or several paragraphs got spliced into the option's paragraph, which nests <li> inside <p> and drops every paragraph after the first. An empty :description: override left an empty <p>. Only a leading paragraph now shares the option line; other nodes go under the list item as blocks, and blank description or epilog text renders nothing.
gaborbernat
force-pushed
the
help-nodes
branch
from
August 27, 2026 16:24
eb0ff9d to
c4f19b0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
help=" "crashed the build withIndexError: list index out of range: the string is truthy,nested_parseyields no nodes, and the code indexedtemp.children[0]. Help that parses into something other than a paragraph, such as a bullet list or two paragraphs underRawTextHelpFormatter, landed inside the option's<p>, which puts<li>inside<p>and drops every paragraph after the first. 馃悰 An empty:description:override also left a bare<p></p>in the page.The option line now takes only a leading paragraph inline after the
-separator; any remaining nodes, or all of them when the first is not a paragraph, become blocks under the list item, and_protect_option_dashesruns over the whole item so--flagsin those blocks keep their dashes._pre_formattreats a blank block the same as a missing one.The text builder output for an empty description or epilog loses one blank line; the two exact-output tests reflect that.