aboutsummaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/kotlin/Formats/MarkdownFormatService.kt2
-rw-r--r--core/src/test/kotlin/format/MarkdownFormatTest.kt4
2 files changed, 6 insertions, 0 deletions
diff --git a/core/src/main/kotlin/Formats/MarkdownFormatService.kt b/core/src/main/kotlin/Formats/MarkdownFormatService.kt
index 794deedd..fc63b2f2 100644
--- a/core/src/main/kotlin/Formats/MarkdownFormatService.kt
+++ b/core/src/main/kotlin/Formats/MarkdownFormatService.kt
@@ -164,12 +164,14 @@ open class MarkdownOutputBuilder(to: StringBuilder,
}
override fun appendBlockCode(language: String, body: () -> Unit) {
+ inCodeBlock = true
ensureParagraph()
to.appendln(if (language.isEmpty()) "```" else "``` $language")
body()
ensureNewline()
to.appendln("```")
appendLine()
+ inCodeBlock = false
}
override fun appendTable(vararg columns: String, body: () -> Unit) {
diff --git a/core/src/test/kotlin/format/MarkdownFormatTest.kt b/core/src/test/kotlin/format/MarkdownFormatTest.kt
index 1dfffbff..7f0922ba 100644
--- a/core/src/test/kotlin/format/MarkdownFormatTest.kt
+++ b/core/src/test/kotlin/format/MarkdownFormatTest.kt
@@ -135,6 +135,10 @@ class MarkdownFormatTest {
}
}
+ @Test fun codeBlockNoHtmlEscape() {
+ verifyMarkdownNodeByName("codeBlockNoHtmlEscape", "hackTheArithmetic")
+ }
+
@Test fun companionObjectExtension() {
verifyMarkdownNodeByName("companionObjectExtension", "Foo")
}