diff --git a/packages/core/src/api/parsers/markdown/markdownToHtml.ts b/packages/core/src/api/parsers/markdown/markdownToHtml.ts index 2380397db4..450f403ea6 100644 --- a/packages/core/src/api/parsers/markdown/markdownToHtml.ts +++ b/packages/core/src/api/parsers/markdown/markdownToHtml.ts @@ -139,7 +139,7 @@ function trySoftBreak( i: number ): { html: string; end: number } | null { if (text[i] === "\n") { - return { html: "\n", end: i + 1 }; + return { html: "
\n", end: i + 1 }; } return null; } diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/blockquoteLazyContinuation.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/blockquoteLazyContinuation.json index 4bf1e40314..146a54b49b 100644 --- a/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/blockquoteLazyContinuation.json +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/blockquoteLazyContinuation.json @@ -4,7 +4,9 @@ "content": [ { "styles": {}, - "text": "This is a quote that continues here and here too", + "text": "This is a quote + that continues here + and here too", "type": "text", }, ], diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/blockquoteMultiline.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/blockquoteMultiline.json index abe3612e64..669e44db40 100644 --- a/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/blockquoteMultiline.json +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/blockquoteMultiline.json @@ -4,7 +4,9 @@ "content": [ { "styles": {}, - "text": "Line one Line two Line three", + "text": "Line one + Line two + Line three", "type": "text", }, ], diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/paragraphContinuation.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/lineBreaks.json similarity index 84% rename from tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/paragraphContinuation.json rename to tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/lineBreaks.json index 6f7169f109..359a3b1cbc 100644 --- a/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/paragraphContinuation.json +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/lineBreaks.json @@ -4,7 +4,9 @@ "content": [ { "styles": {}, - "text": "Line one still same paragraph", + "text": "Line one + Line two + Line three", "type": "text", }, ], diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/paragraphLeadingIndent.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/paragraphLeadingIndent.json index b249d3a2d8..613cf56ae2 100644 --- a/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/paragraphLeadingIndent.json +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/paragraphLeadingIndent.json @@ -4,7 +4,8 @@ "content": [ { "styles": {}, - "text": "aaa bbb", + "text": "aaa + bbb", "type": "text", }, ], diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/singleNewLines.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/singleNewLines.json new file mode 100644 index 0000000000..3cd78e1f12 --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/markdown/singleNewLines.json @@ -0,0 +1,22 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Line 1 + Line 2 + Line 3 + Line 4", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/parseTestInstances.ts b/tests/src/unit/core/formatConversion/parse/parseTestInstances.ts index 0da7436615..5bb72fec41 100644 --- a/tests/src/unit/core/formatConversion/parse/parseTestInstances.ts +++ b/tests/src/unit/core/formatConversion/parse/parseTestInstances.ts @@ -1689,12 +1689,13 @@ Third paragraph`, }, executeTest: testParseMarkdown, }, - // Paragraph continuation (lines without blank line) + // Line breaks { testCase: { - name: "paragraphContinuation", + name: "lineBreaks", content: `Line one -still same paragraph`, +Line two +Line three`, }, executeTest: testParseMarkdown, },