Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,12 @@ fun AnnotatedString.Builder.appendMarkdownReference(
buildMarkdownAnnotatedString(content, linkText.mapAutoLinkToType(), annotatorSettings)
}
} else {
// if no reference is found, reference links are just rendered as normal text.
append(node.getUnescapedTextInNode(content))
// if no reference is found, reference links are rendered as their individual components
val linkText = node.findChildOfType(MarkdownElementTypes.LINK_TEXT)
if (linkText != null) {
buildMarkdownAnnotatedString(content, linkText, annotatorSettings)
Comment on lines +187 to +189
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable shadowing: The variable name linkText is already used in this function scope (line 167). Consider using a different name like linkTextNode to avoid confusion and improve code clarity. The shadowed variable has type List<ASTNode>? while this new variable has type ASTNode?, which makes the distinction even more important.

Suggested change
val linkText = node.findChildOfType(MarkdownElementTypes.LINK_TEXT)
if (linkText != null) {
buildMarkdownAnnotatedString(content, linkText, annotatorSettings)
val linkTextNode = node.findChildOfType(MarkdownElementTypes.LINK_TEXT)
if (linkTextNode != null) {
buildMarkdownAnnotatedString(content, linkTextNode, annotatorSettings)

Copilot uses AI. Check for mistakes.
}
buildMarkdownAnnotatedString(content, labelNode, annotatorSettings)
Comment on lines +186 to +191
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new behavior for rendering markdown inside brackets when no reference is found lacks test coverage. Consider adding a test case in sample/android/src/screenshotTest/kotlin/com/mikepenz/markdown/ui/m3/LinkTests.kt (and the m2 equivalent) that includes examples like [**bold text**] or [*italic*] to verify the fix works as intended and prevent future regressions.

Copilot uses AI. Check for mistakes.
}
}

Expand Down
Loading