Skip to content

Conversation

@thmarx
Copy link
Collaborator

@thmarx thmarx commented Jan 17, 2026

The previous implementation of the Markdown renderer processed inline elements sequentially without recursion. This caused issues with nested elements, such as a link inside a bold tag, where the inner element was treated as plain text.

This commit refactors the inline parsing mechanism to be recursive:

  • The InlineElementRule interface is updated to provide the InlineElementTokenizer to each rule.
  • Container rules (Strong, Italic, Strikethrough) now re-invoke the tokenizer on their content, allowing for nested elements to be parsed correctly.
  • A test case has been added to IssuesTest.java to verify the fix for **[link](url)** and prevent regressions.
  • All inline element rules and their corresponding tests have been updated to reflect the new architecture.

The previous implementation of the Markdown renderer processed inline elements sequentially without recursion. This caused issues with nested elements, such as a link inside a bold tag, where the inner element was treated as plain text.

This commit refactors the inline parsing mechanism to be recursive:
- The `InlineElementRule` interface is updated to provide the `InlineElementTokenizer` to each rule.
- Container rules (Strong, Italic, Strikethrough) now re-invoke the tokenizer on their content, allowing for nested elements to be parsed correctly.
- A test case has been added to `IssuesTest.java` to verify the fix for `**[link](url)**` and prevent regressions.
- All inline element rules and their corresponding tests have been updated to reflect the new architecture.
@thmarx thmarx added this to the 8.0.0 milestone Jan 17, 2026
@thmarx thmarx self-assigned this Jan 17, 2026
@thmarx thmarx merged commit d9af5e3 into CondationCMS:main Jan 17, 2026
1 check passed
@thmarx thmarx deleted the fix/markdown-nested-elements-17977399442854792281 branch January 17, 2026 12:01
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