mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Update for pending RSCore String updates
This commit is contained in:
@@ -69,10 +69,10 @@ private extension FeedSpecifier {
|
||||
score = score + 50
|
||||
}
|
||||
|
||||
if urlString.rs_caseInsensitiveContains("comments") {
|
||||
if urlString.caseInsensitiveContains("comments") {
|
||||
score = score - 10
|
||||
}
|
||||
if urlString.rs_caseInsensitiveContains("rss") {
|
||||
if urlString.caseInsensitiveContains("rss") {
|
||||
score = score + 5
|
||||
}
|
||||
if urlString.hasSuffix("/feed/") {
|
||||
@@ -81,15 +81,15 @@ private extension FeedSpecifier {
|
||||
if urlString.hasSuffix("/feed") {
|
||||
score = score + 4
|
||||
}
|
||||
if urlString.rs_caseInsensitiveContains("json") {
|
||||
if urlString.caseInsensitiveContains("json") {
|
||||
score = score + 6
|
||||
}
|
||||
|
||||
if let title = title {
|
||||
if title.rs_caseInsensitiveContains("comments") {
|
||||
if title.caseInsensitiveContains("comments") {
|
||||
score = score - 10
|
||||
}
|
||||
if title.rs_caseInsensitiveContains("json") {
|
||||
if title.caseInsensitiveContains("json") {
|
||||
score = score + 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class HTMLFeedFinder {
|
||||
for oneBodyLink in bodyLinks {
|
||||
|
||||
if linkMightBeFeed(oneBodyLink) {
|
||||
let normalizedURL = oneBodyLink.urlString.rs_normalizedURL()
|
||||
let normalizedURL = oneBodyLink.urlString.normalizedURL
|
||||
let oneFeedSpecifier = FeedSpecifier(title: oneBodyLink.text, urlString: normalizedURL, source: .HTMLLink)
|
||||
addFeedSpecifier(oneFeedSpecifier)
|
||||
}
|
||||
|
||||
@@ -183,9 +183,9 @@ extension Folder: OPMLRepresentable {
|
||||
}
|
||||
}()
|
||||
|
||||
let escapedTitle = nameForDisplay.rs_stringByEscapingSpecialXMLCharacters()
|
||||
let escapedTitle = nameForDisplay.escapingSpecialXMLCharacters
|
||||
var s = "<outline text=\"\(escapedTitle)\" title=\"\(escapedTitle)\"\(attrExternalID)>\n"
|
||||
s = s.rs_string(byPrependingNumberOfTabs: indentLevel)
|
||||
s = s.prepending(tabCount: indentLevel)
|
||||
|
||||
var hasAtLeastOneChild = false
|
||||
|
||||
@@ -196,11 +196,11 @@ extension Folder: OPMLRepresentable {
|
||||
|
||||
if !hasAtLeastOneChild {
|
||||
s = "<outline text=\"\(escapedTitle)\" title=\"\(escapedTitle)\"\(attrExternalID)/>\n"
|
||||
s = s.rs_string(byPrependingNumberOfTabs: indentLevel)
|
||||
s = s.prepending(tabCount: indentLevel)
|
||||
return s
|
||||
}
|
||||
|
||||
s = s + NSString.rs_string(withNumberOfTabs: indentLevel) + "</outline>\n"
|
||||
s = s + String(tabCount: indentLevel) + "</outline>\n"
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ private extension OPMLFile {
|
||||
}
|
||||
|
||||
func opmlDocument() -> String {
|
||||
let escapedTitle = account.nameForDisplay.rs_stringByEscapingSpecialXMLCharacters()
|
||||
let escapedTitle = account.nameForDisplay.escapingSpecialXMLCharacters
|
||||
let openingText =
|
||||
"""
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
@@ -43,7 +43,7 @@ public final class WebFeed: Feed, Renamable, Hashable {
|
||||
}
|
||||
set {
|
||||
if let url = newValue, !url.isEmpty {
|
||||
metadata.homePageURL = url.rs_normalizedURL()
|
||||
metadata.homePageURL = url.normalizedURL
|
||||
}
|
||||
else {
|
||||
metadata.homePageURL = nil
|
||||
@@ -256,16 +256,16 @@ extension WebFeed: OPMLRepresentable {
|
||||
if nameToUse == nil {
|
||||
nameToUse = ""
|
||||
}
|
||||
let escapedName = nameToUse!.rs_stringByEscapingSpecialXMLCharacters()
|
||||
let escapedName = nameToUse!.escapingSpecialXMLCharacters
|
||||
|
||||
var escapedHomePageURL = ""
|
||||
if let homePageURL = homePageURL {
|
||||
escapedHomePageURL = homePageURL.rs_stringByEscapingSpecialXMLCharacters()
|
||||
escapedHomePageURL = homePageURL.escapingSpecialXMLCharacters
|
||||
}
|
||||
let escapedFeedURL = url.rs_stringByEscapingSpecialXMLCharacters()
|
||||
let escapedFeedURL = url.escapingSpecialXMLCharacters
|
||||
|
||||
var s = "<outline text=\"\(escapedName)\" title=\"\(escapedName)\" description=\"\" type=\"rss\" version=\"RSS\" htmlUrl=\"\(escapedHomePageURL)\" xmlUrl=\"\(escapedFeedURL)\"/>\n"
|
||||
s = s.rs_string(byPrependingNumberOfTabs: indentLevel)
|
||||
s = s.prepending(tabCount: indentLevel)
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public func databaseIDWithString(_ s: String) -> String {
|
||||
return identifier
|
||||
}
|
||||
|
||||
let identifier = (s as NSString).rs_md5Hash()
|
||||
let identifier = s.md5HashString
|
||||
databaseIDCache[s] = identifier
|
||||
return identifier
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ final class ArticleSearchInfo: Hashable {
|
||||
|
||||
lazy var bodyForIndex: String = {
|
||||
let s = preferredText.rsparser_stringByDecodingHTMLEntities()
|
||||
return s.rs_string(byStrippingHTML: 0).rs_stringWithCollapsedWhitespace()
|
||||
return s.strippingHTML().collapsingWhitespace
|
||||
}()
|
||||
|
||||
init(articleID: String, title: String?, contentHTML: String?, contentText: String?, summary: String?, searchRowID: Int?) {
|
||||
|
||||
Reference in New Issue
Block a user