ref: hide all html tags by default
This commit is contained in:
@@ -23,11 +23,7 @@ extension PreviewGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Process info stored in `Info.plist`
|
/// Process info stored in `Info.plist`
|
||||||
mutating func procAppInfo(_ appPlist: PlistDict?, isOSX: Bool) {
|
mutating func procAppInfoApple(_ appPlist: PlistDict, isOSX: Bool) {
|
||||||
guard let appPlist else {
|
|
||||||
self.apply(["AppInfoHidden": CLASS_HIDDEN])
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let minVersion = appPlist[isOSX ? "LSMinimumSystemVersion" : "MinimumOSVersion"] as? String ?? ""
|
let minVersion = appPlist[isOSX ? "LSMinimumSystemVersion" : "MinimumOSVersion"] as? String ?? ""
|
||||||
|
|
||||||
let extensionType = (appPlist["NSExtension"] as? PlistDict)?["NSExtensionPointIdentifier"] as? String
|
let extensionType = (appPlist["NSExtension"] as? PlistDict)?["NSExtensionPointIdentifier"] as? String
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ extension PreviewGenerator {
|
|||||||
/// Process info of `.xcarchive` stored in root `Info.plist`
|
/// Process info of `.xcarchive` stored in root `Info.plist`
|
||||||
mutating func procArchiveInfo(_ archivePlist: PlistDict?) {
|
mutating func procArchiveInfo(_ archivePlist: PlistDict?) {
|
||||||
guard let archivePlist, let comment = archivePlist["Comment"] as? String else {
|
guard let archivePlist, let comment = archivePlist["Comment"] as? String else {
|
||||||
self.apply(["ArchiveHidden": CLASS_HIDDEN])
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ extension PreviewGenerator {
|
|||||||
entitlements.applyFallbackIfNeeded(provisionPlist?["Entitlements"] as? PlistDict)
|
entitlements.applyFallbackIfNeeded(provisionPlist?["Entitlements"] as? PlistDict)
|
||||||
|
|
||||||
if entitlements.html == nil && !entitlements.hasError {
|
if entitlements.html == nil && !entitlements.hasError {
|
||||||
self.apply(["EntitlementsHidden" : CLASS_HIDDEN])
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -114,7 +114,6 @@ extension PreviewGenerator {
|
|||||||
/// Process info stored in `embedded.mobileprovision`
|
/// Process info stored in `embedded.mobileprovision`
|
||||||
mutating func procProvision(_ provisionPlist: PlistDict?, isOSX: Bool) {
|
mutating func procProvision(_ provisionPlist: PlistDict?, isOSX: Bool) {
|
||||||
guard let provisionPlist else {
|
guard let provisionPlist else {
|
||||||
self.apply(["ProvisionHidden": CLASS_HIDDEN])
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ extension PreviewGenerator {
|
|||||||
/// Process ATS info in `Info.plist`
|
/// Process ATS info in `Info.plist`
|
||||||
mutating func procTransportSecurity(_ appPlist: PlistDict?) {
|
mutating func procTransportSecurity(_ appPlist: PlistDict?) {
|
||||||
guard let value = appPlist?["NSAppTransportSecurity"] as? PlistDict else {
|
guard let value = appPlist?["NSAppTransportSecurity"] as? PlistDict else {
|
||||||
self.apply(["TransportSecurityHidden": CLASS_HIDDEN])
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ extension PreviewGenerator {
|
|||||||
/// Process info stored in `iTunesMetadata.plist`
|
/// Process info stored in `iTunesMetadata.plist`
|
||||||
mutating func procItunesMeta(_ itunesPlist: PlistDict?) {
|
mutating func procItunesMeta(_ itunesPlist: PlistDict?) {
|
||||||
guard let itunesPlist else {
|
guard let itunesPlist else {
|
||||||
self.apply(["iTunesHidden": CLASS_HIDDEN])
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,18 @@ let CLASS_HIDDEN = "hidden"
|
|||||||
let CLASS_VISIBLE = ""
|
let CLASS_VISIBLE = ""
|
||||||
|
|
||||||
struct PreviewGenerator {
|
struct PreviewGenerator {
|
||||||
var data: [String: String] = [:] // used for TAG replacements
|
/// Used for TAG replacements
|
||||||
|
var data: [String: String] = [
|
||||||
|
// default: hide everything
|
||||||
|
"AppInfoHidden": CLASS_HIDDEN,
|
||||||
|
"AppExtensionTypeHidden": CLASS_HIDDEN,
|
||||||
|
"ArchiveHidden": CLASS_HIDDEN,
|
||||||
|
"iTunesHidden": CLASS_HIDDEN,
|
||||||
|
"TransportSecurityHidden": CLASS_HIDDEN,
|
||||||
|
"EntitlementsHidden": CLASS_HIDDEN,
|
||||||
|
"EntitlementsWarningHidden": CLASS_HIDDEN,
|
||||||
|
"ProvisionHidden": CLASS_HIDDEN,
|
||||||
|
]
|
||||||
let meta: MetaInfo
|
let meta: MetaInfo
|
||||||
|
|
||||||
init(_ meta: MetaInfo) throws {
|
init(_ meta: MetaInfo) throws {
|
||||||
|
|||||||
Reference in New Issue
Block a user