diff --git a/Frameworks/Account/Account.swift b/Frameworks/Account/Account.swift index 4c03c47f3..5d367d628 100644 --- a/Frameworks/Account/Account.swift +++ b/Frameworks/Account/Account.swift @@ -1261,13 +1261,13 @@ extension Account { extension Account: OPMLRepresentable { - public func OPMLString(indentLevel: Int, strictConformance: Bool) -> String { + public func OPMLString(indentLevel: Int, allowCustomAttributes: Bool) -> String { var s = "" for feed in topLevelWebFeeds.sorted() { - s += feed.OPMLString(indentLevel: indentLevel + 1, strictConformance: strictConformance) + s += feed.OPMLString(indentLevel: indentLevel + 1, allowCustomAttributes: allowCustomAttributes) } for folder in folders!.sorted() { - s += folder.OPMLString(indentLevel: indentLevel + 1, strictConformance: strictConformance) + s += folder.OPMLString(indentLevel: indentLevel + 1, allowCustomAttributes: allowCustomAttributes) } return s } diff --git a/Frameworks/Account/Folder.swift b/Frameworks/Account/Folder.swift index e69e4c939..1420eb3de 100644 --- a/Frameworks/Account/Folder.swift +++ b/Frameworks/Account/Folder.swift @@ -173,10 +173,10 @@ private extension Folder { extension Folder: OPMLRepresentable { - public func OPMLString(indentLevel: Int, strictConformance: Bool) -> String { + public func OPMLString(indentLevel: Int, allowCustomAttributes: Bool) -> String { let attrExternalID: String = { - if !strictConformance, let externalID = externalID { + if allowCustomAttributes, let externalID = externalID { return " nnw_externalID=\"\(externalID)\"" } else { return "" @@ -190,7 +190,7 @@ extension Folder: OPMLRepresentable { var hasAtLeastOneChild = false for feed in topLevelWebFeeds.sorted() { - s += feed.OPMLString(indentLevel: indentLevel + 1, strictConformance: strictConformance) + s += feed.OPMLString(indentLevel: indentLevel + 1, allowCustomAttributes: allowCustomAttributes) hasAtLeastOneChild = true } diff --git a/Frameworks/Account/OPMLFile.swift b/Frameworks/Account/OPMLFile.swift index e6cc1917f..c070eaae2 100644 --- a/Frameworks/Account/OPMLFile.swift +++ b/Frameworks/Account/OPMLFile.swift @@ -138,7 +138,7 @@ private extension OPMLFile { """ - let middleText = account.OPMLString(indentLevel: 0, strictConformance: false) + let middleText = account.OPMLString(indentLevel: 0, allowCustomAttributes: true) let closingText = """ diff --git a/Frameworks/Account/WebFeed.swift b/Frameworks/Account/WebFeed.swift index 828321f8b..df0679a13 100644 --- a/Frameworks/Account/WebFeed.swift +++ b/Frameworks/Account/WebFeed.swift @@ -245,7 +245,7 @@ public final class WebFeed: Feed, Renamable, Hashable { extension WebFeed: OPMLRepresentable { - public func OPMLString(indentLevel: Int, strictConformance: Bool) -> String { + public func OPMLString(indentLevel: Int, allowCustomAttributes: Bool) -> String { // https://github.com/brentsimmons/NetNewsWire/issues/527 // Don’t use nameForDisplay because that can result in a feed name "Untitled" written to disk, // which NetNewsWire may take later to be the actual name. diff --git a/Mac/MainWindow/NNW3/NNW3Document.swift b/Mac/MainWindow/NNW3/NNW3Document.swift index 536f5500d..1352a9634 100644 --- a/Mac/MainWindow/NNW3/NNW3Document.swift +++ b/Mac/MainWindow/NNW3/NNW3Document.swift @@ -32,7 +32,7 @@ struct NNW3Document { extension NNW3Document: OPMLRepresentable { - func OPMLString(indentLevel: Int, strictConformance: Bool) -> String { + func OPMLString(indentLevel: Int, allowCustomAttributes: Bool) -> String { var s = """ @@ -46,7 +46,7 @@ extension NNW3Document: OPMLRepresentable { if let children = children { for child in children { - s += child.OPMLString(indentLevel: indentLevel + 1, strictConformance: true) + s += child.OPMLString(indentLevel: indentLevel + 1) } } @@ -94,7 +94,7 @@ private struct NNW3Folder { extension NNW3Folder: OPMLRepresentable { - func OPMLString(indentLevel: Int, strictConformance: Bool) -> String { + func OPMLString(indentLevel: Int, allowCustomAttributes: Bool) -> String { let t = title?.rs_stringByEscapingSpecialXMLCharacters() ?? "" guard let children = children else { // Empty folder. @@ -103,7 +103,7 @@ extension NNW3Folder: OPMLRepresentable { var s = "\n".rs_string(byPrependingNumberOfTabs: indentLevel) for child in children { - s += child.OPMLString(indentLevel: indentLevel + 1, strictConformance: true) + s += child.OPMLString(indentLevel: indentLevel + 1) } s += "\n".rs_string(byPrependingNumberOfTabs: indentLevel) @@ -130,7 +130,7 @@ private struct NNW3Feed { extension NNW3Feed: OPMLRepresentable { - func OPMLString(indentLevel: Int, strictConformance: Bool) -> String { + func OPMLString(indentLevel: Int, allowCustomAttributes: Bool) -> String { let t = title?.rs_stringByEscapingSpecialXMLCharacters() ?? "" let p = homePageURL?.rs_stringByEscapingSpecialXMLCharacters() ?? "" let f = feedURL?.rs_stringByEscapingSpecialXMLCharacters() ?? "" diff --git a/Mac/MainWindow/NNW3/NNW3ImportController.swift b/Mac/MainWindow/NNW3/NNW3ImportController.swift index f3103e1e1..9459626bf 100644 --- a/Mac/MainWindow/NNW3/NNW3ImportController.swift +++ b/Mac/MainWindow/NNW3/NNW3ImportController.swift @@ -93,7 +93,7 @@ private extension NNW3ImportController { guard let document = NNW3Document(subscriptionsPlistURL: url) else { return nil } - let opml = document.OPMLString(indentLevel: 0, strictConformance: true) + let opml = document.OPMLString(indentLevel: 0) let opmlURL = FileManager.default.temporaryDirectory.appendingPathComponent("NNW3.opml") do { diff --git a/Mac/Scriptability/Account+Scriptability.swift b/Mac/Scriptability/Account+Scriptability.swift index d0272c621..e4ad348ef 100644 --- a/Mac/Scriptability/Account+Scriptability.swift +++ b/Mac/Scriptability/Account+Scriptability.swift @@ -150,7 +150,7 @@ class ScriptableAccount: NSObject, UniqueIdScriptingObject, ScriptingObjectConta @objc(opmlRepresentation) var opmlRepresentation:String { - return self.account.OPMLString(indentLevel:0, strictConformance: true) + return self.account.OPMLString(indentLevel:0) } @objc(accountType) diff --git a/Mac/Scriptability/Folder+Scriptability.swift b/Mac/Scriptability/Folder+Scriptability.swift index 2229ce3a7..9e25698d4 100644 --- a/Mac/Scriptability/Folder+Scriptability.swift +++ b/Mac/Scriptability/Folder+Scriptability.swift @@ -110,7 +110,7 @@ class ScriptableFolder: NSObject, UniqueIdScriptingObject, ScriptingObjectContai @objc(opmlRepresentation) var opmlRepresentation:String { - return self.folder.OPMLString(indentLevel:0, strictConformance: true) + return self.folder.OPMLString(indentLevel:0) } } diff --git a/Mac/Scriptability/WebFeed+Scriptability.swift b/Mac/Scriptability/WebFeed+Scriptability.swift index 6c20c3dea..d99b84f01 100644 --- a/Mac/Scriptability/WebFeed+Scriptability.swift +++ b/Mac/Scriptability/WebFeed+Scriptability.swift @@ -146,7 +146,7 @@ class ScriptableWebFeed: NSObject, UniqueIdScriptingObject, ScriptingObjectConta @objc(opmlRepresentation) var opmlRepresentation:String { - return self.webFeed.OPMLString(indentLevel:0, strictConformance: true) + return self.webFeed.OPMLString(indentLevel:0) } // MARK: --- scriptable elements --- diff --git a/Shared/Exporters/OPMLExporter.swift b/Shared/Exporters/OPMLExporter.swift index 75dde22d5..c177431ef 100644 --- a/Shared/Exporters/OPMLExporter.swift +++ b/Shared/Exporters/OPMLExporter.swift @@ -27,7 +27,7 @@ struct OPMLExporter { """ - let middleText = account.OPMLString(indentLevel: 0, strictConformance: true) + let middleText = account.OPMLString(indentLevel: 0) let closingText = """ diff --git a/submodules/RSCore b/submodules/RSCore index 2eca01e52..cd379dbbb 160000 --- a/submodules/RSCore +++ b/submodules/RSCore @@ -1 +1 @@ -Subproject commit 2eca01e52f7b722b25523d46d2341baa54dca6d1 +Subproject commit cd379dbbb8a0574e111b9846685a1d43006367f7