Repository navigation
Conversation
Children of a block were rendered with the parent's numbered-list counter
and handed the result back to it, so a nested numbered list continued the
parent's numbering ("1. A / 2. A.1") and the next sibling skipped ahead
("4. B"). Children now count from zero and the parent's counter is kept.
|
@MohammadHijjawi97 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
blocknote_to_markdownrenders a block's children with a fresh numbered-list counter instead of reusing and overwriting the parent's.Why
Children were rendered with the parent's
numbered_list_counter, and the value they returned replaced it. A nested numbered list therefore continued the parent's numbering, and the next sibling skipped ahead. For a listFirst(childrenSub A,Sub B), thenSecond:This converter is used when exporting or opening legacy BlockNote notes (
export_service.resolve_document_markdown,editor_routes), so the exported Markdown had wrong numbers.test_mixed_deep_nested_children_indentationhad captured the old output (2. Nested Child 2for a child of1. Nested Child 1) and is updated.How to test
The new test fails before the change and passes after.
ruff checkandruff format --checkare clean on the changed files.High-level PR Summary
This PR fixes a bug in the
blocknote_to_markdownconverter where nested numbered lists incorrectly continued their parent's numbering instead of starting fresh at 1. The fix ensures each nested list maintains its own independent counter, preventing sibling items from skipping numbers. This affects Markdown exports and legacy BlockNote note rendering.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
surfsense_backend/tests/unit/utils/test_blocknote_to_markdown.pysurfsense_backend/app/utils/blocknote_to_markdown.py