From fd64654e1e1af20c097320915ec9c367a0374ad9 Mon Sep 17 00:00:00 2001 From: rztime Date: Mon, 16 Oct 2023 17:04:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=87=E7=AD=BE=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RZRichTextView/Classes/RZCss.swift | 4 ++-- RZRichTextView/Classes/RZHtml.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RZRichTextView/Classes/RZCss.swift b/RZRichTextView/Classes/RZCss.swift index 557bd60..b4ba8e8 100644 --- a/RZRichTextView/Classes/RZCss.swift +++ b/RZRichTextView/Classes/RZCss.swift @@ -170,11 +170,11 @@ public extension NSTextAttachment { guard let info = self.rzattachmentInfo else { return ""} switch info.type { case .audio: - return "" + return "" case .image: return "" case .video: - return "" + return "" } } } diff --git a/RZRichTextView/Classes/RZHtml.swift b/RZRichTextView/Classes/RZHtml.swift index a15a4c2..6a90de3 100644 --- a/RZRichTextView/Classes/RZHtml.swift +++ b/RZRichTextView/Classes/RZHtml.swift @@ -266,7 +266,7 @@ public extension String { var tempHtml = html as NSString var attachments: [RZAttachmentInfo] = [] /// 找音、视频、图片 - let regrule = #"(]+)\b.*?>(.*?))|(]+)\b.*?>(.*?))|(]+)\b.*?>)"# + let regrule = #"(]+)\b.*?>([\s\S]*?))|(]+)\b.*?>([\s\S]*?))|(]+)\b.*?>)"# if let regex = try? NSRegularExpression.init(pattern: regrule, options: .caseInsensitive) { var labels:[RZLabelInfo] = [] let matches = regex.matches(in: tempHtml as String, range: NSRange.init(location: 0, length: tempHtml.length))