diff options
author | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-15 18:23:15 +0400 |
---|---|---|
committer | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-15 18:23:15 +0400 |
commit | fb41c698ae26774e6bf71a0ed49b46c57c4023a9 (patch) | |
tree | a59f30756c79fad626770d9a32b97c49c14f9ef9 /src/Formats/MarkdownFormatService.kt | |
parent | eebfdd41acc897ba9177f1c8daa428a079c8e99f (diff) | |
download | dokka-fb41c698ae26774e6bf71a0ed49b46c57c4023a9.tar.gz dokka-fb41c698ae26774e6bf71a0ed49b46c57c4023a9.tar.bz2 dokka-fb41c698ae26774e6bf71a0ed49b46c57c4023a9.zip |
Improve rendering of lambdas, escape html symbols.
Diffstat (limited to 'src/Formats/MarkdownFormatService.kt')
-rw-r--r-- | src/Formats/MarkdownFormatService.kt | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Formats/MarkdownFormatService.kt b/src/Formats/MarkdownFormatService.kt index 6a76343d..3768c3f1 100644 --- a/src/Formats/MarkdownFormatService.kt +++ b/src/Formats/MarkdownFormatService.kt @@ -10,6 +10,10 @@ public open class MarkdownFormatService(locationService: LocationService, signat return items.map { formatLink(it) }.joinToString(" / ") } + override public fun formatText(text: String): String { + return text.htmlEscape() + } + override public fun formatCode(code: String): String { return "`$code`" } @@ -27,11 +31,11 @@ public open class MarkdownFormatService(locationService: LocationService, signat } override public fun appendLine(to: StringBuilder, text: String) { - to.appendln(text) + to.appendln(formatText(text)) } override public fun appendText(to: StringBuilder, text: String) { - to.append(text) + to.append(formatText(text)) } override public fun appendHeader(to: StringBuilder, text: String, level: Int) { @@ -41,15 +45,17 @@ public open class MarkdownFormatService(locationService: LocationService, signat } override public fun appendBlockCode(to: StringBuilder, lines: Iterable<String>) { + appendLine(to) appendLine(to, "```") for (line in lines) - appendLine(to, line) + to.appendln(line) appendLine(to, "```") + appendLine(to) } override public fun appendBlockCode(to: StringBuilder, line: String) { appendLine(to, "```") - appendLine(to, line) + to.appendln(line) appendLine(to, "```") } |