aboutsummaryrefslogtreecommitdiff
path: root/src/Formats/MarkdownFormatService.kt
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-15 20:05:55 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-15 20:05:55 +0400
commitaa59acbaf96e961d28e614a2932f100bea766b4f (patch)
treece889f7b51112c65ddff362003a82000b21ed644 /src/Formats/MarkdownFormatService.kt
parent7c204a38f374c4ac403810fa11a2d4310f4ec1f4 (diff)
downloaddokka-aa59acbaf96e961d28e614a2932f100bea766b4f.tar.gz
dokka-aa59acbaf96e961d28e614a2932f100bea766b4f.tar.bz2
dokka-aa59acbaf96e961d28e614a2932f100bea766b4f.zip
Support tables in formatters and add proper escaping of html
Diffstat (limited to 'src/Formats/MarkdownFormatService.kt')
-rw-r--r--src/Formats/MarkdownFormatService.kt29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/Formats/MarkdownFormatService.kt b/src/Formats/MarkdownFormatService.kt
index 3768c3f1..60e38290 100644
--- a/src/Formats/MarkdownFormatService.kt
+++ b/src/Formats/MarkdownFormatService.kt
@@ -31,11 +31,11 @@ public open class MarkdownFormatService(locationService: LocationService, signat
}
override public fun appendLine(to: StringBuilder, text: String) {
- to.appendln(formatText(text))
+ to.appendln(text)
}
override public fun appendText(to: StringBuilder, text: String) {
- to.append(formatText(text))
+ to.append(text)
}
override public fun appendHeader(to: StringBuilder, text: String, level: Int) {
@@ -59,6 +59,31 @@ public open class MarkdownFormatService(locationService: LocationService, signat
appendLine(to, "```")
}
+ override fun appendTable(to: StringBuilder, body: () -> Unit) {
+ to.appendln()
+ body()
+ to.appendln()
+ }
+
+ override fun appendTableHeader(to: StringBuilder, body: () -> Unit) {
+ body()
+ }
+
+ override fun appendTableBody(to: StringBuilder, body: () -> Unit) {
+ body()
+ }
+
+ override fun appendTableRow(to: StringBuilder, body: () -> Unit) {
+ to.append("|")
+ body()
+ to.appendln()
+ }
+
+ override fun appendTableCell(to: StringBuilder, body: () -> Unit) {
+ body()
+ to.append("|")
+ }
+
var outlineLevel = 0
override fun appendOutlineHeader(to: StringBuilder, node: DocumentationNode) {
val indent = " ".repeat(outlineLevel)