From fcbabb8d837be4cd5a0f71b901a83aa0d1a677d0 Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Wed, 10 Mar 2021 12:07:05 +0000 Subject: [PATCH] Add newline after each fragment --- Sources/Ink/API/MarkdownParser.swift | 2 +- Tests/InkTests/CodeTests.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Ink/API/MarkdownParser.swift b/Sources/Ink/API/MarkdownParser.swift index 78c5eed..d183e1f 100644 --- a/Sources/Ink/API/MarkdownParser.swift +++ b/Sources/Ink/API/MarkdownParser.swift @@ -111,7 +111,7 @@ public struct MarkdownParser { let plainText = fragments.reduce(into: "", { result, wrapper in let plainText = wrapper.fragment.plainText() - result.append(plainText) + result.append("\(plainText)\n") }) return Markdown( diff --git a/Tests/InkTests/CodeTests.swift b/Tests/InkTests/CodeTests.swift index a7928a5..661bfff 100644 --- a/Tests/InkTests/CodeTests.swift +++ b/Tests/InkTests/CodeTests.swift @@ -14,7 +14,7 @@ final class CodeTests: XCTestCase { let plainText = MarkdownParser().plainText(from: markdown) XCTAssertEqual(html, "

Hello inline.code()

") - XCTAssertEqual(plainText, "Hello inline.code()") + XCTAssertEqual(plainText, "Hello inline.code()\n") } func testCodeBlockWithJustBackticks() {