diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-26 21:17:13 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-26 21:17:13 +0100 |
commit | 4b61be354510cf88fed33860c987bd210502e91d (patch) | |
tree | 7b7bb9f317cf0edfe1cdee404b6b34ff02e39054 /src/Formats | |
parent | 11bc0b1ceef4340e7587b85b647010faf171131b (diff) | |
download | dokka-4b61be354510cf88fed33860c987bd210502e91d.tar.gz dokka-4b61be354510cf88fed33860c987bd210502e91d.tar.bz2 dokka-4b61be354510cf88fed33860c987bd210502e91d.zip |
don't generate redundant links that lead to the same page with no anchor (e.g. receiver type in extension functions)
Diffstat (limited to 'src/Formats')
-rw-r--r-- | src/Formats/StructuredFormatService.kt | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Formats/StructuredFormatService.kt b/src/Formats/StructuredFormatService.kt index 70b2a3c1..dd23b7b3 100644 --- a/src/Formats/StructuredFormatService.kt +++ b/src/Formats/StructuredFormatService.kt @@ -61,11 +61,19 @@ public abstract class StructuredFormatService(locationService: LocationService, val node = content.node val linkTo = if (node != null) locationHref(location, node) else "#" val linkText = formatText(location, content.children) - append(formatLink(linkText, linkTo)) + if (linkTo == ".") { + append(linkText) + } else { + append(formatLink(linkText, linkTo)) + } } is ContentExternalLink -> { val linkText = formatText(location, content.children) - append(formatLink(linkText, content.href)) + if (content.href == ".") { + append(linkText) + } else { + append(formatLink(linkText, content.href)) + } } is ContentParagraph -> { appendParagraph(this, formatText(location, content.children)) |