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:
@@ -159,7 +159,7 @@ private func filenameWithStyleSuffixRemoved(_ filename: String) -> String {
|
||||
|
||||
for oneSuffix in styleSuffixes {
|
||||
if filename.hasSuffix(oneSuffix) {
|
||||
return (filename as NSString).rs_string(byStrippingSuffix: oneSuffix, caseSensitive: false)
|
||||
return filename.stripping(suffix: oneSuffix)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,8 +65,8 @@ struct ArticleStringFormatter {
|
||||
s = s.replacingOccurrences(of: "\r", with: "")
|
||||
s = s.replacingOccurrences(of: "\t", with: "")
|
||||
s = s.rsparser_stringByDecodingHTMLEntities()
|
||||
s = s.rs_stringByTrimmingWhitespace()
|
||||
s = s.rs_stringWithCollapsedWhitespace()
|
||||
s = s.trimmingWhitespace
|
||||
s = s.collapsingWhitespace
|
||||
|
||||
let maxLength = 1000
|
||||
if s.count < maxLength {
|
||||
@@ -89,9 +89,9 @@ struct ArticleStringFormatter {
|
||||
return cachedBody
|
||||
}
|
||||
var s = body.rsparser_stringByDecodingHTMLEntities()
|
||||
s = s.rs_string(byStrippingHTML: 250)
|
||||
s = s.rs_stringByTrimmingWhitespace()
|
||||
s = s.rs_stringWithCollapsedWhitespace()
|
||||
s = s.strippingHTML(maxCharacters: 250)
|
||||
s = s.trimmingWhitespace
|
||||
s = s.collapsingWhitespace
|
||||
if s == "Comments" { // Hacker News.
|
||||
s = ""
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ struct OPMLExporter {
|
||||
|
||||
static func OPMLString(with account: Account, title: String) -> String {
|
||||
|
||||
let escapedTitle = title.rs_stringByEscapingSpecialXMLCharacters()
|
||||
let escapedTitle = title.escapingSpecialXMLCharacters
|
||||
let openingText =
|
||||
"""
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
@@ -6,7 +6,12 @@
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
#if os(macOS)
|
||||
import AppKit
|
||||
#else
|
||||
import UIKit
|
||||
#endif
|
||||
|
||||
import RSCore
|
||||
|
||||
extension RSImage {
|
||||
|
||||
@@ -114,7 +114,7 @@ final class FaviconDownloader {
|
||||
|
||||
func favicon(withHomePageURL homePageURL: String) -> IconImage? {
|
||||
|
||||
let url = homePageURL.rs_normalizedURL()
|
||||
let url = homePageURL.normalizedURL
|
||||
|
||||
if let url = URL(string: homePageURL) {
|
||||
if url.host == "nnw.ranchero.com" {
|
||||
|
||||
@@ -34,7 +34,7 @@ final class SingleFaviconDownloader {
|
||||
private let queue: DispatchQueue
|
||||
|
||||
private var diskKey: String {
|
||||
return (faviconURL as NSString).rs_md5Hash()
|
||||
return faviconURL.md5HashString
|
||||
}
|
||||
|
||||
init(faviconURL: String, homePageURL: String?, diskCache: BinaryDiskCache, queue: DispatchQueue) {
|
||||
|
||||
@@ -128,7 +128,7 @@ private extension ImageDownloader {
|
||||
|
||||
func diskKey(_ url: String) -> String {
|
||||
|
||||
return (url as NSString).rs_md5Hash()
|
||||
return url.md5HashString
|
||||
}
|
||||
|
||||
func postImageDidBecomeAvailableNotification(_ url: String) {
|
||||
|
||||
Reference in New Issue
Block a user