aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-02-12 17:29:04 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-02-12 17:29:04 +0100
commitf3bed4012efe860f02dfdb7c73c0a7fe2d6bcbfa (patch)
tree817ef195661ab9b62bfee60d6fd14a691011cbf6
parent5b8da9860f1404aafa4343670da483cd2c9a8cbf (diff)
downloaddokka-f3bed4012efe860f02dfdb7c73c0a7fe2d6bcbfa.tar.gz
dokka-f3bed4012efe860f02dfdb7c73c0a7fe2d6bcbfa.tar.bz2
dokka-f3bed4012efe860f02dfdb7c73c0a7fe2d6bcbfa.zip
process bracket tokens in markdown
-rw-r--r--src/Kotlin/ContentBuilder.kt4
-rw-r--r--test/data/format/bracket.html14
-rw-r--r--test/data/format/bracket.kt4
-rw-r--r--test/src/format/HtmlFormatTest.kt6
4 files changed, 27 insertions, 1 deletions
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 @@
+<HTML>
+<HEAD>
+<title>test / foo</title>
+</HEAD>
+<BODY>
+<a href="out.html">test</a>&nbsp;/&nbsp;<a href="out.html"></a>&nbsp;/&nbsp;<a href="out.html">foo</a><br/>
+<br/>
+<h1>foo</h1>
+<code><span class="keyword">fun </span><span class="identifier">foo</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><span class="identifier">Unit</span></code><br/>
+<p>bar[]</p>
+<br/>
+<br/>
+</BODY>
+</HTML>
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)