Skip to content

Commit 566016e

Browse files
committed
Fix Html issue
1 parent f8503e2 commit 566016e

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

ForumateTests/ForumateTests.swift

-9
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,4 @@ import XCTest
99
@testable import Forumate
1010

1111
final class ForumateTests: XCTestCase {
12-
func testReplaceHTMLLink() throws {
13-
let input = #"""
14-
Hello <a href="example.com">label</a> World
15-
"""#
16-
let expectedOutput = #"""
17-
Hello [label](example.com) World
18-
"""#
19-
XCTAssertEqual(input.replacingHTMLLink(), expectedOutput)
20-
}
2112
}

HtmlText/Sources/HtmlText/AttributedText.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ public struct AttributedText: View {
3030

3131
// FIXME: "’" will get a strange effect, we replace it with "'" as a workaround
3232
private var fixedString: String {
33-
html.replacing(#//#) { _ in "'" }
33+
html.replacing(#//#) { _ in "'" }
3434
}
3535
}
3636

3737
#Preview {
3838
VStack {
3939
AttributedText(rawHtml: "Topics <br>related</br> to the <a href=\"https://github.com/apple/swift-evolution/blob/main/process.md\">Swift Evolution Process</a>.")
40-
AttributedText(rawHtml: "Questions, feedback, and best practices around building with OpenAIs API. Please read the <a href=\"https://platform.openai.com/overview\">API docs</a> before posting.")
40+
AttributedText(rawHtml: "Questions, feedback, and best practices around building with OpenAIs API. Please read the <a href=\"https://platform.openai.com/overview\">API docs</a> before posting.")
4141
}
4242
}

0 commit comments

Comments
 (0)