From ea1fa238eca98e053788aea388b5b9c7a012eafd Mon Sep 17 00:00:00 2001
From: Oleg Bask Paragraph 0 Paragraph 0
+ continue p0 Paragraph 2 Paragraph 7 Paragraph 8 Paragraph 8
+ continue p8 Paragraph 0 Paragraph 0
+ continue p0 Paragraph 2 Paragraph 7 Paragraph CHANGE Paragraph CHANGE
+ continue p8 Paragraph 0 Paragraph 0
+ continue p0 Paragraph 2 Paragraph 7 Paragraph 8 Paragraph 8
+ continue p8 Paragraph 0 Paragraph 0
+ continue p0 Paragraph 2 Paragraph 7
- Paragraph 8Header 1
@@ -94,6 +101,7 @@ class MarkdownProcessorTest {
Paragraph 7
Paragraph 8
+ continue p8
""".trimIndent(),
)
assertHtmlEquals(
@@ -113,7 +121,8 @@ class MarkdownProcessorTest {
line 6-2
Header 1
@@ -166,7 +178,8 @@ class MarkdownProcessorTest {
line 6-2
Header 1
@@ -220,7 +236,8 @@ class MarkdownProcessorTest {
line 6-2
Header 1
@@ -275,7 +295,8 @@ class MarkdownProcessorTest {
line 6-2
Paragraph 0
+Paragraph 0 + continue p0
Paragraph 2
Paragraph 7
-Paragraph 8
+Paragraph 8 + continue p8
""".trimIndent(), secondRun, @@ -345,6 +370,7 @@ class MarkdownProcessorTest { val secondRun = processor.processWithQuickEdits( """ Paragraph 0 + continue p0 # Header 1 Paragraph 2 * list item 3-1 @@ -357,11 +383,13 @@ class MarkdownProcessorTest { Paragraph 7 Paragraph 8 + continue p8 """.trimIndent(), ) assertHtmlEquals( """ -Paragraph 0
+Paragraph 0 + continue p0
Paragraph 2
Paragraph 7
-Paragraph 8
+Paragraph 8 + continue p8
""".trimIndent(), secondRun, @@ -391,6 +420,7 @@ class MarkdownProcessorTest { val firstRun = processor.processWithQuickEdits(rawMarkdown) val secondDocument = """ Paragraph 0 + continue p0 # Header 1 Paragraph 2 * list item 3-1 @@ -412,13 +442,15 @@ class MarkdownProcessorTest { Paragraph 7 Paragraph 8 + continue p8 """.trimIndent() val secondRun = processor.processWithQuickEdits( secondDocument, ) assertHtmlEquals( """ -Paragraph 0
+Paragraph 0 + continue p0
Paragraph 2
Paragraph 7
-Paragraph 8
+Paragraph 8 + continue p8
""".trimIndent(), secondRun, @@ -454,7 +487,8 @@ class MarkdownProcessorTest { val secondRun = processor.processWithQuickEdits(rawMarkdown) assertHtmlEquals( """ -Paragraph 0
+Paragraph 0 + continue p0
Paragraph 2
Paragraph 7
-Paragraph 8
+Paragraph 8 + continue p8
""".trimIndent(), secondRun, @@ -484,7 +519,8 @@ class MarkdownProcessorTest { val secondRun = processor.processWithQuickEdits("\n" + rawMarkdown) assertHtmlEquals( """ -Paragraph 0
+Paragraph 0 + continue p0
Paragraph 2
Paragraph 7
-Paragraph 8
+Paragraph 8 + continue p8
""".trimIndent(), secondRun, @@ -508,6 +545,20 @@ class MarkdownProcessorTest { assertSame(firstRun[1], secondRun[1]) } + /** Regression https://github.com/JetBrains/jewel/issues/344 */ + @Test + fun `content if empty`() { + val processor = MarkdownProcessor() + processor.processWithQuickEdits(rawMarkdown) + val secondRun = processor.processWithQuickEdits("") + assertHtmlEquals( + """ + """.trimIndent(), + secondRun, + ) + processor.processWithQuickEdits(rawMarkdown) + } + @Test fun `chained changes`() { val processor = MarkdownProcessor()