From 4a64c4cbd2310abad2fe9fb26be58edb99d149d1 Mon Sep 17 00:00:00 2001 From: Rajdeep Kwatra Date: Fri, 1 Mar 2024 14:48:26 +1100 Subject: [PATCH] Added debug option for ListMarker display (#291) --- .../TextProcessors/ListTextProcessor.swift | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Proton/Sources/Swift/TextProcessors/TextProcessors/ListTextProcessor.swift b/Proton/Sources/Swift/TextProcessors/TextProcessors/ListTextProcessor.swift index ad7134ac..15454e39 100644 --- a/Proton/Sources/Swift/TextProcessors/TextProcessors/ListTextProcessor.swift +++ b/Proton/Sources/Swift/TextProcessors/TextProcessors/ListTextProcessor.swift @@ -21,6 +21,11 @@ import Foundation import UIKit +public enum ListMarkerDebugOption { + case `default` + case replace(with: String) +} + /// Text process capable of processing keyboard inputs specific to lists. `ListTextProcessor` only works after a range of text /// has been converted to list using `ListCommand`. /// @@ -34,9 +39,19 @@ import UIKit open class ListTextProcessor: TextProcessing { public let name = "listProcessor" + + public static var markerDebugOptions: ListMarkerDebugOption = .default + // Zero width space - used for laying out the list bullet/number in an empty line. // This is required when using tab on a blank bullet line. Without this, layout calculations are not performed. - static let blankLineFiller = "\u{200B}" + static var blankLineFiller: String { + switch markerDebugOptions { + case .default: + return "\u{200B}" + case .replace(let string): + return string + } + } /// Initializes text processor. public init() { }