From f3bed4012efe860f02dfdb7c73c0a7fe2d6bcbfa Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 12 Feb 2015 17:29:04 +0100 Subject: process bracket tokens in markdown --- src/Kotlin/ContentBuilder.kt | 4 +++- test/data/format/bracket.html | 14 ++++++++++++++ test/data/format/bracket.kt | 4 ++++ test/src/format/HtmlFormatTest.kt | 6 ++++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 test/data/format/bracket.html create mode 100644 test/data/format/bracket.kt diff --git a/src/Kotlin/ContentBuilder.kt b/src/Kotlin/ContentBuilder.kt index 3d44c11b..4d6938bf 100644 --- a/src/Kotlin/ContentBuilder.kt +++ b/src/Kotlin/ContentBuilder.kt @@ -109,7 +109,9 @@ public fun DocumentationBuilder.buildContentTo(tree: MarkdownNode, target: Conte MarkdownTokenTypes.LT, MarkdownTokenTypes.GT, MarkdownTokenTypes.LPAREN, - MarkdownTokenTypes.RPAREN -> { + MarkdownTokenTypes.RPAREN, + MarkdownTokenTypes.LBRACKET, + MarkdownTokenTypes.RBRACKET -> { parent.append(ContentText(node.text)) } else -> { diff --git a/test/data/format/bracket.html b/test/data/format/bracket.html new file mode 100644 index 00000000..24a7aec2 --- /dev/null +++ b/test/data/format/bracket.html @@ -0,0 +1,14 @@ + + +test / foo + + +test /  / foo
+
+

foo

+fun foo(): Unit
+

bar[]

+
+
+ + diff --git a/test/data/format/bracket.kt b/test/data/format/bracket.kt new file mode 100644 index 00000000..d41b0073 --- /dev/null +++ b/test/data/format/bracket.kt @@ -0,0 +1,4 @@ +/** + * bar[] + */ +fun foo() {} diff --git a/test/src/format/HtmlFormatTest.kt b/test/src/format/HtmlFormatTest.kt index 1e469b91..247cc057 100644 --- a/test/src/format/HtmlFormatTest.kt +++ b/test/src/format/HtmlFormatTest.kt @@ -64,6 +64,12 @@ public class HtmlFormatTest { } } + Test fun bracket() { + verifyOutput("test/data/format/bracket.kt", ".html") { model, output -> + htmlService.appendNodes(tempLocation, output, model.members.single().members) + } + } + Test fun see() { verifyOutput("test/data/format/see.kt", ".html") { model, output -> htmlService.appendNodes(tempLocation, output, model.members.single().members) -- cgit