aboutsummaryrefslogtreecommitdiff
path: root/src/Formats/KotlinWebsiteFormatService.kt
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-02-26 19:34:49 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-02-26 19:34:49 +0100
commit44cef5ccc67c329ea2184aa00e8dc9eac5ca7f77 (patch)
tree1e389e8e9a91862e94b5901d7ee3d46c9d6bd42c /src/Formats/KotlinWebsiteFormatService.kt
parent4f59034a9436ff23b021a878dba753b67d62b742 (diff)
downloaddokka-44cef5ccc67c329ea2184aa00e8dc9eac5ca7f77.tar.gz
dokka-44cef5ccc67c329ea2184aa00e8dc9eac5ca7f77.tar.bz2
dokka-44cef5ccc67c329ea2184aa00e8dc9eac5ca7f77.zip
syntax highlight code examples
Diffstat (limited to 'src/Formats/KotlinWebsiteFormatService.kt')
-rw-r--r--src/Formats/KotlinWebsiteFormatService.kt19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/Formats/KotlinWebsiteFormatService.kt b/src/Formats/KotlinWebsiteFormatService.kt
index dd33f5c4..a009132b 100644
--- a/src/Formats/KotlinWebsiteFormatService.kt
+++ b/src/Formats/KotlinWebsiteFormatService.kt
@@ -63,17 +63,14 @@ public class KotlinWebsiteFormatService(locationService: LocationService,
to.appendln("\n</td>")
}
- override public fun appendBlockCode(to: StringBuilder, lines: Iterable<String>) {
- to.append("<pre markdown=\"1\">")
- for (line in lines)
- to.appendln(line)
- to.append(to, "</pre>")
- }
-
- override public fun appendBlockCode(to: StringBuilder, line: String) {
- to.append("<pre markdown=\"1\">")
- to.append(line.trimLeading())
- to.append("</pre>")
+ override public fun appendBlockCode(to: StringBuilder, line: String, language: String) {
+ if (language.isNotEmpty()) {
+ super.appendBlockCode(to, line, language)
+ } else {
+ to.append("<pre markdown=\"1\">")
+ to.append(line.trimLeading())
+ to.append("</pre>")
+ }
}
override fun formatSymbol(text: String): String {