From f5e5800a70c4c72366908970cb235efab4b43efd Mon Sep 17 00:00:00 2001 From: Toni Sevener Date: Fri, 15 Dec 2023 14:23:47 -0600 Subject: [PATCH] Use formatter in editor --- .../WKSourceEditorTextFrameworkMediator.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Components/Sources/Components/Components/Editors/Source Editor/WKSourceEditorTextFrameworkMediator.swift b/Components/Sources/Components/Components/Editors/Source Editor/WKSourceEditorTextFrameworkMediator.swift index 2f856b8e3e6..dbe15ce1e3d 100644 --- a/Components/Sources/Components/Components/Editors/Source Editor/WKSourceEditorTextFrameworkMediator.swift +++ b/Components/Sources/Components/Components/Editors/Source Editor/WKSourceEditorTextFrameworkMediator.swift @@ -35,6 +35,7 @@ final class WKSourceEditorTextFrameworkMediator: NSObject { private(set) var formatters: [WKSourceEditorFormatter] = [] private(set) var boldItalicsFormatter: WKSourceEditorFormatterBoldItalics? private(set) var templateFormatter: WKSourceEditorFormatterTemplate? + private(set) var strikethroughFormatter: WKSourceEditorFormatterStrikethrough? var isSyntaxHighlightingEnabled: Bool = true { didSet { @@ -103,11 +104,14 @@ final class WKSourceEditorTextFrameworkMediator: NSObject { let boldItalicsFormatter = WKSourceEditorFormatterBoldItalics(colors: colors, fonts: fonts) let templateFormatter = WKSourceEditorFormatterTemplate(colors: colors, fonts: fonts) + let strikethroughFormatter = WKSourceEditorFormatterStrikethrough(colors: colors, fonts: fonts) + self.formatters = [WKSourceEditorFormatterBase(colors: colors, fonts: fonts, textAlignment: viewModel.textAlignment), templateFormatter, - boldItalicsFormatter] + boldItalicsFormatter, + strikethroughFormatter] self.boldItalicsFormatter = boldItalicsFormatter - self.templateFormatter = templateFormatter + self.strikethroughFormatter = strikethroughFormatter if needsTextKit2 { if #available(iOS 16.0, *) {