From 2ceff9c41cff42b7fb3ffe75ea36a7c570f3615b Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Fri, 17 Feb 2017 17:40:32 +0300 Subject: Fix for GH-136 GH-137 Blank lines inside code blocks are not preserved --- core/testdata/format/blankLineInsideCodeBlock.html | 18 ++++++++++++++++++ core/testdata/format/blankLineInsideCodeBlock.kt | 12 ++++++++++++ core/testdata/format/blankLineInsideCodeBlock.md | 14 ++++++++++++++ core/testdata/format/codeBlock.html | 6 ++++-- core/testdata/format/tripleBackticks.html | 3 ++- core/testdata/javadoc/blankLineInsideCodeBlock.kt | 12 ++++++++++++ 6 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 core/testdata/format/blankLineInsideCodeBlock.html create mode 100644 core/testdata/format/blankLineInsideCodeBlock.kt create mode 100644 core/testdata/format/blankLineInsideCodeBlock.md create mode 100644 core/testdata/javadoc/blankLineInsideCodeBlock.kt (limited to 'core/testdata') diff --git a/core/testdata/format/blankLineInsideCodeBlock.html b/core/testdata/format/blankLineInsideCodeBlock.html new file mode 100644 index 00000000..168dd0dd --- /dev/null +++ b/core/testdata/format/blankLineInsideCodeBlock.html @@ -0,0 +1,18 @@ + + + +u - test + + +test / u
+
+

u

+ +fun u(): Unit
This is a test
+    of Dokka's code blocks.
+Here is a blank line.
+
+The previous line was blank.
+
+ + diff --git a/core/testdata/format/blankLineInsideCodeBlock.kt b/core/testdata/format/blankLineInsideCodeBlock.kt new file mode 100644 index 00000000..9430f4d5 --- /dev/null +++ b/core/testdata/format/blankLineInsideCodeBlock.kt @@ -0,0 +1,12 @@ +/** + * ``` + * This is a test + * of Dokka's code blocks. + * Here is a blank line. + * + * The previous line was blank. + * ``` + */ +fun u() { + +} \ No newline at end of file diff --git a/core/testdata/format/blankLineInsideCodeBlock.md b/core/testdata/format/blankLineInsideCodeBlock.md new file mode 100644 index 00000000..66f4d65f --- /dev/null +++ b/core/testdata/format/blankLineInsideCodeBlock.md @@ -0,0 +1,14 @@ +[test](test/index) / [u](test/u) + +# u + +`fun u(): Unit` + +``` +This is a test + of Dokka's code blocks. +Here is a blank line. + +The previous line was blank. +``` + diff --git a/core/testdata/format/codeBlock.html b/core/testdata/format/codeBlock.html index b3b65dba..48c2ffd2 100644 --- a/core/testdata/format/codeBlock.html +++ b/core/testdata/format/codeBlock.html @@ -10,11 +10,13 @@

This annotation indicates what exceptions should be declared by a function when compiled to a JVM method.

Example:

Throws(IOException::class)
-fun readFile(name: String): String {...}
test / ItDoesSomeObfuscatedThing
+fun readFile(name: String): String {...} +test / ItDoesSomeObfuscatedThing

ItDoesSomeObfuscatedThing

class ItDoesSomeObfuscatedThing

Check output of

-
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
+
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
+
diff --git a/core/testdata/format/tripleBackticks.html b/core/testdata/format/tripleBackticks.html index 5b3aef82..bac3385c 100644 --- a/core/testdata/format/tripleBackticks.html +++ b/core/testdata/format/tripleBackticks.html @@ -10,6 +10,7 @@ fun f(): Unit

Description

-
code sample
+
code sample
+
diff --git a/core/testdata/javadoc/blankLineInsideCodeBlock.kt b/core/testdata/javadoc/blankLineInsideCodeBlock.kt new file mode 100644 index 00000000..9430f4d5 --- /dev/null +++ b/core/testdata/javadoc/blankLineInsideCodeBlock.kt @@ -0,0 +1,12 @@ +/** + * ``` + * This is a test + * of Dokka's code blocks. + * Here is a blank line. + * + * The previous line was blank. + * ``` + */ +fun u() { + +} \ No newline at end of file -- cgit