Skip to content

Commit 0aa45e0

Browse files
authored
Merge pull request #493 from mikepenz/fix/488
Fix markdown display within `[]`
2 parents c1ecb68 + 96da370 commit 0aa45e0

File tree

1 file changed

+6
-2
lines changed
  • multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/annotator

1 file changed

+6
-2
lines changed

multiplatform-markdown-renderer/src/commonMain/kotlin/com/mikepenz/markdown/annotator/AnnotatedStringKtx.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,12 @@ fun AnnotatedString.Builder.appendMarkdownReference(
183183
buildMarkdownAnnotatedString(content, linkText.mapAutoLinkToType(), annotatorSettings)
184184
}
185185
} else {
186-
// if no reference is found, reference links are just rendered as normal text.
187-
append(node.getUnescapedTextInNode(content))
186+
// if no reference is found, reference links are rendered as their individual components
187+
val linkText = node.findChildOfType(MarkdownElementTypes.LINK_TEXT)
188+
if (linkText != null) {
189+
buildMarkdownAnnotatedString(content, linkText, annotatorSettings)
190+
}
191+
buildMarkdownAnnotatedString(content, labelNode, annotatorSettings)
188192
}
189193
}
190194

0 commit comments

Comments
 (0)