mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-06-06 05:48:50 +00:00
Remove extra line break from spoiler text
This commit is contained in:
parent
4c40adc195
commit
508b180a1d
1 changed files with 6 additions and 0 deletions
|
@ -29,6 +29,7 @@ public struct HTMLString: Codable, Equatable, Hashable {
|
||||||
|
|
||||||
let document: Document = try SwiftSoup.parse(htmlValue)
|
let document: Document = try SwiftSoup.parse(htmlValue)
|
||||||
handleNode(node: document)
|
handleNode(node: document)
|
||||||
|
|
||||||
document.outputSettings(OutputSettings().prettyPrint(pretty: false))
|
document.outputSettings(OutputSettings().prettyPrint(pretty: false))
|
||||||
try document.select("br").after("\n")
|
try document.select("br").after("\n")
|
||||||
try document.select("p").after("\n\n")
|
try document.select("p").after("\n\n")
|
||||||
|
@ -40,6 +41,11 @@ public struct HTMLString: Codable, Equatable, Hashable {
|
||||||
_ = text.removeLast()
|
_ = text.removeLast()
|
||||||
}
|
}
|
||||||
asRawText = text
|
asRawText = text
|
||||||
|
|
||||||
|
if asMarkdown.hasPrefix("\n") {
|
||||||
|
_ = asMarkdown.removeFirst()
|
||||||
|
}
|
||||||
|
|
||||||
} catch {
|
} catch {
|
||||||
asRawText = htmlValue
|
asRawText = htmlValue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue