diff options
author | Dmitry Jemerov <intelliyole@gmail.com> | 2016-01-04 13:42:18 +0100 |
---|---|---|
committer | Dmitry Jemerov <intelliyole@gmail.com> | 2016-01-04 13:42:18 +0100 |
commit | 0260b37dd051fc5d728820fa20b0ad7d94c33c0f (patch) | |
tree | fd0d71cc5924564036775b320ee6e25afc899605 /core/src | |
parent | dc4c930d8aab39776c4b5db7ff483075d725ae74 (diff) | |
parent | 89a36e0eed4a31856cca0cedb9b67ce79cee5100 (diff) | |
download | dokka-0260b37dd051fc5d728820fa20b0ad7d94c33c0f.tar.gz dokka-0260b37dd051fc5d728820fa20b0ad7d94c33c0f.tar.bz2 dokka-0260b37dd051fc5d728820fa20b0ad7d94c33c0f.zip |
Merge pull request #43 from ingokegel/master
Embedded underscores and stars were removed in the output
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/kotlin/Kotlin/ContentBuilder.kt | 6 | ||||
-rw-r--r-- | core/src/test/kotlin/format/HtmlFormatTest.kt | 6 | ||||
-rw-r--r-- | core/src/test/kotlin/markdown/ParserTest.kt | 12 |
3 files changed, 24 insertions, 0 deletions
diff --git a/core/src/main/kotlin/Kotlin/ContentBuilder.kt b/core/src/main/kotlin/Kotlin/ContentBuilder.kt index c4bb18de..1a6ffb98 100644 --- a/core/src/main/kotlin/Kotlin/ContentBuilder.kt +++ b/core/src/main/kotlin/Kotlin/ContentBuilder.kt @@ -103,6 +103,12 @@ public fun buildContentTo(tree: MarkdownNode, target: ContentBlock, linkResolver parent.append(createEntityOrText(node.text)) } + MarkdownTokenTypes.EMPH -> { + if (node.parent?.type != MarkdownElementTypes.EMPH) { + parent.append(ContentText(node.text)) + } + } + MarkdownTokenTypes.COLON, MarkdownTokenTypes.DOUBLE_QUOTE, MarkdownTokenTypes.LT, diff --git a/core/src/test/kotlin/format/HtmlFormatTest.kt b/core/src/test/kotlin/format/HtmlFormatTest.kt index 593dbfe6..8045d38c 100644 --- a/core/src/test/kotlin/format/HtmlFormatTest.kt +++ b/core/src/test/kotlin/format/HtmlFormatTest.kt @@ -153,5 +153,11 @@ public class HtmlFormatTest { htmlService.appendNodes(tempLocation, output, model.members.single().members.filter { it.name == "Bar" }) } } + + @Test fun uninterpretedEmphasisCharacters() { + verifyOutput("testdata/format/uninterpretedEmphasisCharacters.kt", ".html") { model, output -> + htmlService.appendNodes(tempLocation, output, model.members.single().members) + } + } } diff --git a/core/src/test/kotlin/markdown/ParserTest.kt b/core/src/test/kotlin/markdown/ParserTest.kt index 5a7adf05..b0ec68ff 100644 --- a/core/src/test/kotlin/markdown/ParserTest.kt +++ b/core/src/test/kotlin/markdown/ParserTest.kt @@ -86,6 +86,18 @@ number two runTestFor("*text*") } + @Test fun underscoresNoEmph() { + runTestFor("text_with_underscores") + } + + @Test fun emphUnderscores() { + runTestFor("_text_") + } + + @Test fun singleStar() { + runTestFor("Embedded*Star") + } + @Test fun directive() { runTestFor("A text \${code with.another.value} with directive") } |