Skip to content

Fixed markdown renderer dropping content after nested list with code block - #118

Merged
oleg68 merged 3 commits into
nbplugins:mainfrom
oleg68:bugfix/nested-list-code-block
May 17, 2026
Merged

oleg68 merged 3 commits into
nbplugins:mainfrom
oleg68:bugfix/nested-list-code-block

Conversation

@oleg68

@oleg68 oleg68 commented May 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fixed MarkdownRenderer.toHtml() silently discarding headings, paragraphs, and subsequent list items that follow an ordered/unordered list item containing an indented fenced code block
  • Fixed top-level code block after such a list being incorrectly nested inside the deepest sub-list item instead of at the correct depth
  • Refactored MarkdownRendererTest to fixture-based parameterized tests (@ParameterizedTest + @MethodSource), matching the pattern used in ScreenContentDetectorTest; added 29 fixture pairs under src/test/resources/

Root cause

In toHtml(), the continueList branch scanned firstIdx past any non-blank, non-list lines (headings, etc.), which caused that content to be silently dropped. The fix: stop firstIdx at the first non-blank line regardless of type, then process any remaining tail via convertSegment.

Test plan

  • MarkdownRendererTest — 48 tests, all green
  • Full mvn package — BUILD SUCCESS
  • Manual: opened docs/fixture.md in the plugin preview — ## F heading now visible, G code block at correct top-level indentation

🤖 Generated with Claude Code

Oleg Samarin and others added 3 commits May 17, 2026 08:35
toHtml() tests now use @ParameterizedTest with .src.md / .expectedHtml.html
fixture pairs under src/test/resources, matching the ScreenContentDetectorTest
pattern. esc(), inlineToHtml(), and resolveImagePaths() tests remain inline.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ter nested list

When a list item contained an indented code block, content after the list
(headings, paragraphs, a new top-level list) was silently discarded.
The firstIdx scan in the continueList branch now stops at any non-blank
line rather than skipping over non-list content; the tail after the list
is processed via convertSegment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@oleg68
oleg68 merged commit a5d8644 into nbplugins:main May 17, 2026
3 checks passed
@oleg68
oleg68 deleted the bugfix/nested-list-code-block branch May 17, 2026 12:13
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.

1 participant