Repository navigation
fix(jsii-pacmak): Python target crashes on h5 and h6 Markdown headings - #5292
Conversation
md2rst picks a reStructuredText underline character for each heading level from a list that only had four entries. A level 5 or 6 heading in a doc comment therefore threw "TypeError: Cannot read properties of undefined (reading 'repeat')", and jsii-pacmak failed to generate the Python package. Add underline characters for levels 5 and 6. Output for levels 1 to 4 does not change. Fixes aws#4418
|
Queue requested — the merge queue status continues in this comment ↓. |
🚫 Left the queue · pull request branch update failed1 min in the queue, with no time running CI. So far
Reason The pull request can't be updated
To get back in the queue
Requeue requested — the merge queue status continues in this comment ↓. Times in UTC · dashboard · how the merge queue works |
|
Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it! |
|
Merging (with squash)... |
Pull request has been modified.
|
Updated the branch with main, since Mergify couldn't do it without the workflows permission. The new CI runs on 45e0139 are waiting for approval. |
There was a problem hiding this comment.
Thanks @Thanatos9404 ! FYI please don't update this PR from now on, it resets the review approval and everything is much easier for me if I handle any blockers directly. This is just an annoyance of how the system is setup.
|
Merging (with squash)... |
✅ Merged into
|
A level 5 or 6 Markdown heading (
#####or######) in a doc comment makes jsii-pacmak fail when it generates the Python package, withTypeError: Cannot read properties of undefined (reading 'repeat').md2rstlooks up an underline character for each heading level in a list with only four entries, so levels 5 and 6 read past the end. Only the Python target usesmd2rst.This adds
~and+for levels 5 and 6. Output for levels 1 to 4 doesn't change.Tests: added a
level %d headingcase for levels 1 to 6 totest/python.test.ts. Onmainlevels 5 and 6 fail with the TypeError, and with this change all six pass.Side note: the underline never actually shows up in the output at any level, because
textOf(node)is empty for heading nodes. I left that alone so existing docstrings don't change.Fixes #4418
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.