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:
@@ -99,7 +99,7 @@ private extension AddFeedController {
|
||||
|
||||
var urlStringFromPasteboard: String? {
|
||||
if let urlString = NSPasteboard.urlString(from: NSPasteboard.general) {
|
||||
return urlString.rs_normalizedURL()
|
||||
return urlString.normalizedURL
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class AddFeedWindowController : NSWindowController {
|
||||
|
||||
private var userEnteredTitle: String? {
|
||||
var s = nameTextField.stringValue
|
||||
s = s.rs_stringWithCollapsedWhitespace()
|
||||
s = s.collapsingWhitespace
|
||||
if s.isEmpty {
|
||||
return nil
|
||||
}
|
||||
@@ -93,7 +93,7 @@ class AddFeedWindowController : NSWindowController {
|
||||
|
||||
@IBAction func addFeed(_ sender: Any?) {
|
||||
let urlString = urlTextField.stringValue
|
||||
let normalizedURLString = (urlString as NSString).rs_normalizedURL()
|
||||
let normalizedURLString = urlString.normalizedURL
|
||||
|
||||
if normalizedURLString.isEmpty {
|
||||
cancelSheet()
|
||||
@@ -130,7 +130,7 @@ class AddFeedWindowController : NSWindowController {
|
||||
private extension AddFeedWindowController {
|
||||
|
||||
private func updateUI() {
|
||||
addButton.isEnabled = urlTextField.stringValue.rs_stringMayBeURL()
|
||||
addButton.isEnabled = urlTextField.stringValue.mayBeURL
|
||||
}
|
||||
|
||||
func cancelSheet() {
|
||||
|
||||
@@ -67,7 +67,7 @@ private extension DetailStatusBarView {
|
||||
|
||||
func updateLinkForDisplay() {
|
||||
if let mouseoverLink = mouseoverLink, !mouseoverLink.isEmpty {
|
||||
linkForDisplay = (mouseoverLink as NSString).rs_stringByStrippingHTTPOrHTTPSScheme()
|
||||
linkForDisplay = mouseoverLink.strippingHTTPOrHTTPSScheme
|
||||
}
|
||||
else {
|
||||
linkForDisplay = nil
|
||||
|
||||
@@ -95,18 +95,18 @@ private struct NNW3Folder {
|
||||
extension NNW3Folder: OPMLRepresentable {
|
||||
|
||||
func OPMLString(indentLevel: Int, allowCustomAttributes: Bool) -> String {
|
||||
let t = title?.rs_stringByEscapingSpecialXMLCharacters() ?? ""
|
||||
let t = title?.escapingSpecialXMLCharacters ?? ""
|
||||
guard let children = children else {
|
||||
// Empty folder.
|
||||
return "<outline text=\"\(t)\" title=\"\(t)\" />\n".rs_string(byPrependingNumberOfTabs: indentLevel)
|
||||
return "<outline text=\"\(t)\" title=\"\(t)\" />\n".prepending(tabCount: indentLevel)
|
||||
}
|
||||
|
||||
var s = "<outline text=\"\(t)\" title=\"\(t)\">\n".rs_string(byPrependingNumberOfTabs: indentLevel)
|
||||
var s = "<outline text=\"\(t)\" title=\"\(t)\">\n".prepending(tabCount: indentLevel)
|
||||
for child in children {
|
||||
s += child.OPMLString(indentLevel: indentLevel + 1)
|
||||
}
|
||||
|
||||
s += "</outline>\n".rs_string(byPrependingNumberOfTabs: indentLevel)
|
||||
s += "</outline>\n".prepending(tabCount: indentLevel)
|
||||
return s
|
||||
}
|
||||
}
|
||||
@@ -131,12 +131,12 @@ private struct NNW3Feed {
|
||||
extension NNW3Feed: OPMLRepresentable {
|
||||
|
||||
func OPMLString(indentLevel: Int, allowCustomAttributes: Bool) -> String {
|
||||
let t = title?.rs_stringByEscapingSpecialXMLCharacters() ?? ""
|
||||
let p = homePageURL?.rs_stringByEscapingSpecialXMLCharacters() ?? ""
|
||||
let f = feedURL?.rs_stringByEscapingSpecialXMLCharacters() ?? ""
|
||||
let t = title?.escapingSpecialXMLCharacters ?? ""
|
||||
let p = homePageURL?.escapingSpecialXMLCharacters ?? ""
|
||||
let f = feedURL?.escapingSpecialXMLCharacters ?? ""
|
||||
|
||||
var s = "<outline text=\"\(t)\" title=\"\(t)\" description=\"\" type=\"rss\" version=\"RSS\" htmlUrl=\"\(p)\" xmlUrl=\"\(f)\"/>\n"
|
||||
s = s.rs_string(byPrependingNumberOfTabs: indentLevel)
|
||||
s = s.prepending(tabCount: indentLevel)
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@ struct PasteboardWebFeed: Hashable {
|
||||
let isLocalFeed: Bool
|
||||
|
||||
init(url: String, webFeedID: String?, homePageURL: String?, name: String?, editedName: String?, accountID: String?, accountType: AccountType?) {
|
||||
self.url = url.rs_normalizedURL()
|
||||
self.url = url.normalizedURL
|
||||
self.webFeedID = webFeedID
|
||||
self.homePageURL = homePageURL?.rs_normalizedURL()
|
||||
self.homePageURL = homePageURL?.normalizedURL
|
||||
self.name = name
|
||||
self.editedName = editedName
|
||||
self.accountID = accountID
|
||||
@@ -93,7 +93,7 @@ struct PasteboardWebFeed: Hashable {
|
||||
}
|
||||
if let foundType = pasteboardType {
|
||||
if let possibleURLString = pasteboardItem.string(forType: foundType) {
|
||||
if possibleURLString.rs_stringMayBeURL() {
|
||||
if possibleURLString.mayBeURL {
|
||||
self.init(url: possibleURLString, webFeedID: nil, homePageURL: nil, name: nil, editedName: nil, accountID: nil, accountType: nil)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ private extension ArticlePasteboardWriter {
|
||||
s += "\(summary)\n\n"
|
||||
}
|
||||
else if let html = article.contentHTML {
|
||||
let convertedHTML = html.rs_stringByConvertingToPlainText()
|
||||
let convertedHTML = html.convertingToPlainText()
|
||||
s += "\(convertedHTML)\n\n"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user