generated from rnentjes/kotlin-server-web-empty
Add test for ordered list parsing with multi-line items, update parser to increment list index correctly, and bump version to 2.0.1.
This commit is contained in:
8
.idea/artifacts/markdown_parser_js_1_0_10_SNAPSHOT.xml
generated
Normal file
8
.idea/artifacts/markdown_parser_js_1_0_10_SNAPSHOT.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact type="jar" name="markdown-parser-js-1.0.10-SNAPSHOT">
|
||||||
|
<output-path>$PROJECT_DIR$/build/libs</output-path>
|
||||||
|
<root id="archive" name="markdown-parser-js-1.0.10-SNAPSHOT.jar">
|
||||||
|
<element id="module-output" name="markdown-parser.jsMain" />
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
||||||
8
.idea/artifacts/markdown_parser_js_1_0_11_SNAPSHOT.xml
generated
Normal file
8
.idea/artifacts/markdown_parser_js_1_0_11_SNAPSHOT.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact type="jar" name="markdown-parser-js-1.0.11-SNAPSHOT">
|
||||||
|
<output-path>$PROJECT_DIR$/build/libs</output-path>
|
||||||
|
<root id="archive" name="markdown-parser-js-1.0.11-SNAPSHOT.jar">
|
||||||
|
<element id="module-output" name="markdown-parser.jsMain" />
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
||||||
8
.idea/artifacts/markdown_parser_js_1_0_6_SNAPSHOT.xml
generated
Normal file
8
.idea/artifacts/markdown_parser_js_1_0_6_SNAPSHOT.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact type="jar" name="markdown-parser-js-1.0.6-SNAPSHOT">
|
||||||
|
<output-path>$PROJECT_DIR$/build/libs</output-path>
|
||||||
|
<root id="archive" name="markdown-parser-js-1.0.6-SNAPSHOT.jar">
|
||||||
|
<element id="module-output" name="markdown-parser.jsMain" />
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
||||||
8
.idea/artifacts/markdown_parser_js_1_1_0.xml
generated
Normal file
8
.idea/artifacts/markdown_parser_js_1_1_0.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact type="jar" name="markdown-parser-js-1.1.0">
|
||||||
|
<output-path>$PROJECT_DIR$/build/libs</output-path>
|
||||||
|
<root id="archive" name="markdown-parser-js-1.1.0.jar">
|
||||||
|
<element id="module-output" name="markdown-parser.jsMain" />
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
||||||
8
.idea/artifacts/markdown_parser_jvm_1_0_10_SNAPSHOT.xml
generated
Normal file
8
.idea/artifacts/markdown_parser_jvm_1_0_10_SNAPSHOT.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact type="jar" name="markdown-parser-jvm-1.0.10-SNAPSHOT">
|
||||||
|
<output-path>$PROJECT_DIR$/build/libs</output-path>
|
||||||
|
<root id="archive" name="markdown-parser-jvm-1.0.10-SNAPSHOT.jar">
|
||||||
|
<element id="module-output" name="markdown-parser.jvmMain" />
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
||||||
8
.idea/artifacts/markdown_parser_jvm_1_0_11_SNAPSHOT.xml
generated
Normal file
8
.idea/artifacts/markdown_parser_jvm_1_0_11_SNAPSHOT.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact type="jar" name="markdown-parser-jvm-1.0.11-SNAPSHOT">
|
||||||
|
<output-path>$PROJECT_DIR$/build/libs</output-path>
|
||||||
|
<root id="archive" name="markdown-parser-jvm-1.0.11-SNAPSHOT.jar">
|
||||||
|
<element id="module-output" name="markdown-parser.jvmMain" />
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
||||||
8
.idea/artifacts/markdown_parser_jvm_1_0_6_SNAPSHOT.xml
generated
Normal file
8
.idea/artifacts/markdown_parser_jvm_1_0_6_SNAPSHOT.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact type="jar" name="markdown-parser-jvm-1.0.6-SNAPSHOT">
|
||||||
|
<output-path>$PROJECT_DIR$/build/libs</output-path>
|
||||||
|
<root id="archive" name="markdown-parser-jvm-1.0.6-SNAPSHOT.jar">
|
||||||
|
<element id="module-output" name="markdown-parser.jvmMain" />
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
||||||
8
.idea/artifacts/markdown_parser_jvm_1_1_0.xml
generated
Normal file
8
.idea/artifacts/markdown_parser_jvm_1_1_0.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact type="jar" name="markdown-parser-jvm-1.1.0">
|
||||||
|
<output-path>$PROJECT_DIR$/build/libs</output-path>
|
||||||
|
<root id="archive" name="markdown-parser-jvm-1.1.0.jar">
|
||||||
|
<element id="module-output" name="markdown-parser.jvmMain" />
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
||||||
15
.idea/checkstyle-idea.xml
generated
Normal file
15
.idea/checkstyle-idea.xml
generated
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CheckStyle-IDEA" serialisationVersion="2">
|
||||||
|
<checkstyleVersion>13.0.0</checkstyleVersion>
|
||||||
|
<scanScope>JavaOnly</scanScope>
|
||||||
|
<option name="thirdPartyClasspath" />
|
||||||
|
<option name="activeLocationIds" />
|
||||||
|
<option name="locations">
|
||||||
|
<list>
|
||||||
|
<ConfigurationLocation id="bundled-sun-checks" type="BUNDLED" scope="All" description="Sun Checks">(bundled)</ConfigurationLocation>
|
||||||
|
<ConfigurationLocation id="bundled-google-checks" type="BUNDLED" scope="All" description="Google Checks">(bundled)</ConfigurationLocation>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -8,7 +8,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "nl.astraeus"
|
group = "nl.astraeus"
|
||||||
version = "2.0.0"
|
version = "2.0.1"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|||||||
@@ -46,10 +46,11 @@ fun markdown(text: String): List<MarkdownPart> {
|
|||||||
parseBuffer()
|
parseBuffer()
|
||||||
continue
|
continue
|
||||||
} else if (
|
} else if (
|
||||||
line.startsWith("${listIndex++}.")
|
line.startsWith("${listIndex}.")
|
||||||
|| line.startsWith("-.")
|
|| line.startsWith("-.")
|
||||||
|| line.startsWith("#.")
|
|| line.startsWith("#.")
|
||||||
) {
|
) {
|
||||||
|
listIndex++
|
||||||
buffer.append("\n")
|
buffer.append("\n")
|
||||||
buffer.append(rawLine)
|
buffer.append(rawLine)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -225,6 +225,28 @@ class ParseTest {
|
|||||||
assertEquals("Second More text", list.lines[1].text)
|
assertEquals("Second More text", list.lines[1].text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun testOrderedListNumbers() {
|
||||||
|
val input = """
|
||||||
|
Dit is een text
|
||||||
|
|
||||||
|
1. Item 1.
|
||||||
|
Long notes can span multiple lines in edit mode.
|
||||||
|
2. Item 2
|
||||||
|
3. Item 3
|
||||||
|
|
||||||
|
Another paragraph
|
||||||
|
""".trimIndent()
|
||||||
|
|
||||||
|
val md = markdown(input)
|
||||||
|
|
||||||
|
assertEquals(3, md.size)
|
||||||
|
val list = md[1] as MarkdownPart.OrderedList
|
||||||
|
assertEquals(3, list.lines.size)
|
||||||
|
assertEquals("Item 1. Long notes can span multiple lines in edit mode.", list.lines[0].text)
|
||||||
|
assertEquals("Item 2", list.lines[1].text)
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testCheckboxList() {
|
fun testCheckboxList() {
|
||||||
val input = """
|
val input = """
|
||||||
|
|||||||
Reference in New Issue
Block a user