aboutsummaryrefslogtreecommitdiff
path: root/src/Kotlin
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-03-03 19:51:43 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-03-03 19:51:43 +0100
commitf3973480c0b03c9f28f05b5a4cf61bf3de3597bd (patch)
tree54fd4c5b7d30d2daf969c216936663335d1634fd /src/Kotlin
parent6659337410225b813ea902bfa4b2e5ba3c2c1aaa (diff)
downloaddokka-f3973480c0b03c9f28f05b5a4cf61bf3de3597bd.tar.gz
dokka-f3973480c0b03c9f28f05b5a4cf61bf3de3597bd.tar.bz2
dokka-f3973480c0b03c9f28f05b5a4cf61bf3de3597bd.zip
support links with custom labels
Diffstat (limited to 'src/Kotlin')
-rw-r--r--src/Kotlin/ContentBuilder.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Kotlin/ContentBuilder.kt b/src/Kotlin/ContentBuilder.kt
index 4081dc6e..0aa80df0 100644
--- a/src/Kotlin/ContentBuilder.kt
+++ b/src/Kotlin/ContentBuilder.kt
@@ -74,11 +74,13 @@ public fun buildContentTo(tree: MarkdownNode, target: ContentBlock, linkResolver
}
}
}
- MarkdownElementTypes.SHORT_REFERENCE_LINK -> {
+ MarkdownElementTypes.SHORT_REFERENCE_LINK,
+ MarkdownElementTypes.FULL_REFERENCE_LINK -> {
val label = node.child(MarkdownElementTypes.LINK_LABEL)?.child(MarkdownTokenTypes.TEXT)
if (label != null) {
val link = linkResolver(label.text)
- link.append(ContentText(label.text))
+ val linkText = node.child(MarkdownElementTypes.LINK_TEXT)?.child(MarkdownTokenTypes.TEXT)
+ link.append(ContentText(linkText?.text ?: label.text))
parent.append(link)
}
}