1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-11-09 13:10:24 +01:00

Updated UI for presets

This commit is contained in:
2022-05-30 19:34:10 +02:00
parent 19aa804cbb
commit bbebe78997
8 changed files with 322 additions and 226 deletions

View File

@@ -47,5 +47,5 @@ class EditorMenuItem: NSMenuItem {
}
class PresetMenuItem: NSMenuItem {
var preset: CustomPrefs.Preset?
var preset: Preset?
}

View File

@@ -71,4 +71,22 @@ extension String {
}
}
var stripped: String {
do {
guard let data = self.data(using: .unicode) else {
return ""
}
let attributed = try NSAttributedString(
data: data,
options: [
.documentType: NSAttributedString.DocumentType.html,
.characterEncoding: String.Encoding.utf8.rawValue],
documentAttributes: nil
)
return attributed.string
} catch {
return ""
}
}
}