fix: ActiveLabel not respect paragraph tag issue

This commit is contained in:
CMK 2021-07-22 13:06:22 +08:00
parent ccd26c144f
commit 681f78856a
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ public enum MastodonStatusContent {
public static func parse(content: String, emojiDict: EmojiDict) throws -> MastodonStatusContent.ParseResult { public static func parse(content: String, emojiDict: EmojiDict) throws -> MastodonStatusContent.ParseResult {
let document: String = { let document: String = {
var content = content var content = content.replacingOccurrences(of: "</p>", with: "</p>\r\n")
for (shortcode, url) in emojiDict { for (shortcode, url) in emojiDict {
let emojiNode = "<span class=\"emoji\" href=\"\(url.absoluteString)\">\(shortcode)</span>" let emojiNode = "<span class=\"emoji\" href=\"\(url.absoluteString)\">\(shortcode)</span>"
let pattern = ":\(shortcode):" let pattern = ":\(shortcode):"