aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Kotlin/ContentBuilder.kt
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2016-11-01 20:31:16 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2016-11-01 20:31:16 +0300
commit7922e2a940f91b587c70dfb3d41e0048bc93a19e (patch)
tree28055ed18f6eac89419e75f3e6fd18f05ba0bcf1 /core/src/main/kotlin/Kotlin/ContentBuilder.kt
parentee824b90249fd1d6d868af998c6826df31ab557b (diff)
downloaddokka-7922e2a940f91b587c70dfb3d41e0048bc93a19e.tar.gz
dokka-7922e2a940f91b587c70dfb3d41e0048bc93a19e.tar.bz2
dokka-7922e2a940f91b587c70dfb3d41e0048bc93a19e.zip
Fix for GH #97 : Preserve language name of fenced code block for highlight
Diffstat (limited to 'core/src/main/kotlin/Kotlin/ContentBuilder.kt')
-rw-r--r--core/src/main/kotlin/Kotlin/ContentBuilder.kt5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/main/kotlin/Kotlin/ContentBuilder.kt b/core/src/main/kotlin/Kotlin/ContentBuilder.kt
index 61c67787..53afebaf 100644
--- a/core/src/main/kotlin/Kotlin/ContentBuilder.kt
+++ b/core/src/main/kotlin/Kotlin/ContentBuilder.kt
@@ -51,7 +51,10 @@ fun buildContentTo(tree: MarkdownNode, target: ContentBlock, linkResolver: (Stri
}
}
MarkdownElementTypes.CODE_BLOCK,
- MarkdownElementTypes.CODE_FENCE -> appendNodeWithChildren(ContentBlockCode())
+ MarkdownElementTypes.CODE_FENCE -> {
+ val language = node.child(MarkdownTokenTypes.FENCE_LANG)?.text?.trim() ?: ""
+ appendNodeWithChildren(ContentBlockCode(language))
+ }
MarkdownElementTypes.PARAGRAPH -> appendNodeWithChildren(ContentParagraph())
MarkdownElementTypes.INLINE_LINK -> {