mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Add Pinterest link previews.
This commit is contained in:
parent
11af22432d
commit
4060bf0ca4
1 changed files with 2 additions and 2 deletions
|
@ -788,7 +788,7 @@ public class OWSLinkPreview: MTLModel {
|
|||
}
|
||||
|
||||
var title: String?
|
||||
if let rawTitle = NSRegularExpression.parseFirstMatch(pattern: "<meta\\s+property\\s*=\\s*\"og:title\"\\s+content\\s*=\\s*\"(.*?)\"\\s*/?>",
|
||||
if let rawTitle = NSRegularExpression.parseFirstMatch(pattern: "<meta\\s+property\\s*=\\s*\"og:title\"\\s+[^>]*content\\s*=\\s*\"(.*?)\"\\s*[^>]*/?>",
|
||||
text: linkText,
|
||||
options: .dotMatchesLineSeparators) {
|
||||
if let decodedTitle = decodeHTMLEntities(inString: rawTitle) {
|
||||
|
@ -801,7 +801,7 @@ public class OWSLinkPreview: MTLModel {
|
|||
|
||||
Logger.verbose("title: \(String(describing: title))")
|
||||
|
||||
guard let rawImageUrlString = NSRegularExpression.parseFirstMatch(pattern: "<meta\\s+property\\s*=\\s*\"og:image\"\\s+content\\s*=\\s*\"(.*?)\"\\s*/?>", text: linkText) else {
|
||||
guard let rawImageUrlString = NSRegularExpression.parseFirstMatch(pattern: "<meta\\s+property\\s*=\\s*\"og:image\"\\s+[^>]*content\\s*=\\s*\"(.*?)\"[^>]*/?>", text: linkText) else {
|
||||
return OWSLinkPreviewContents(title: title)
|
||||
}
|
||||
guard let imageUrlString = decodeHTMLEntities(inString: rawImageUrlString)?.ows_stripped() else {
|
||||
|
|
Loading…
Reference in a new issue