mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Switch to new Parser.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
import Foundation
|
||||
import Articles
|
||||
import RSParser
|
||||
import Parser
|
||||
|
||||
struct ArticleStringFormatter {
|
||||
|
||||
@@ -66,7 +66,7 @@ struct ArticleStringFormatter {
|
||||
s = s.replacingOccurrences(of: "\t", with: "")
|
||||
|
||||
if !forHTML {
|
||||
s = s.rsparser_stringByDecodingHTMLEntities()
|
||||
s = HTMLEntityDecoder.decodedString(s)
|
||||
}
|
||||
|
||||
s = s.trimmingWhitespace
|
||||
@@ -98,7 +98,7 @@ struct ArticleStringFormatter {
|
||||
if let cachedBody = summaryCache[key] {
|
||||
return cachedBody
|
||||
}
|
||||
var s = body.rsparser_stringByDecodingHTMLEntities()
|
||||
var s = HTMLEntityDecoder.decodedString(body)
|
||||
s = s.strippingHTML(maxCharacters: 250)
|
||||
s = s.trimmingWhitespace
|
||||
s = s.collapsingWhitespace
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import RSParser
|
||||
import Parser
|
||||
|
||||
#if canImport(AppKit)
|
||||
import AppKit
|
||||
@@ -310,6 +310,6 @@ private struct CountedSet<Element> where Element: Hashable {
|
||||
private extension String {
|
||||
var decodedEntity: String {
|
||||
// It's possible the implementation will change, but for now it just calls this.
|
||||
(self as NSString).rsparser_stringByDecodingHTMLEntities() as String
|
||||
HTMLEntityDecoder.decodedString(self)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user