aboutsummaryrefslogtreecommitdiff
path: root/src/Formats/StructuredFormatService.kt
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-10-13 13:38:40 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-10-13 13:38:40 +0400
commit9f0ff55b5f126c31b6d8f3cd28907e5b87601e28 (patch)
tree1d21012d9a337df969a2d8f4ca22d521e26f0207 /src/Formats/StructuredFormatService.kt
parentb3f588ce1d9e6d72b17c1e359008ed90286b1236 (diff)
downloaddokka-9f0ff55b5f126c31b6d8f3cd28907e5b87601e28.tar.gz
dokka-9f0ff55b5f126c31b6d8f3cd28907e5b87601e28.tar.bz2
dokka-9f0ff55b5f126c31b6d8f3cd28907e5b87601e28.zip
Parse and format inline code, fix strong & emph formatting.
Diffstat (limited to 'src/Formats/StructuredFormatService.kt')
-rw-r--r--src/Formats/StructuredFormatService.kt9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Formats/StructuredFormatService.kt b/src/Formats/StructuredFormatService.kt
index df11b835..75b51ab8 100644
--- a/src/Formats/StructuredFormatService.kt
+++ b/src/Formats/StructuredFormatService.kt
@@ -27,7 +27,8 @@ public abstract class StructuredFormatService(val locationService: LocationServi
public abstract fun formatLink(text: String, location: Location): String
public abstract fun formatLink(text: String, href: String): String
public open fun formatLink(link: FormatLink): String = formatLink(formatText(link.text), link.location)
- public abstract fun formatBold(text: String): String
+ public abstract fun formatStrong(text: String): String
+ public abstract fun formatEmphasis(text: String): String
public abstract fun formatCode(code: String): String
public abstract fun formatBreadcrumbs(items: Iterable<FormatLink>): String
@@ -42,7 +43,9 @@ public abstract class StructuredFormatService(val locationService: LocationServi
is ContentSymbol -> append(formatSymbol(content.text))
is ContentKeyword -> append(formatKeyword(content.text))
is ContentIdentifier -> append(formatIdentifier(content.text))
- is ContentEmphasis -> append(formatBold(formatText(location, content.children)))
+ is ContentStrong -> append(formatStrong(formatText(location, content.children)))
+ is ContentCode -> append(formatCode(formatText(location, content.children)))
+ is ContentEmphasis -> append(formatEmphasis(formatText(location, content.children)))
is ContentNodeLink -> {
val linkTo = locationService.relativeLocation(location, content.node, extension)
val linkText = formatText(location, content.children)
@@ -77,7 +80,7 @@ public abstract class StructuredFormatService(val locationService: LocationServi
for ((label, section) in node.doc.sections) {
if (label.startsWith("$"))
continue
- appendLine(to, formatBold(formatText(label)))
+ appendLine(to, formatStrong(formatText(label)))
appendLine(to, formatText(location, section))
appendLine(to)
}