File tree Expand file tree Collapse file tree 7 files changed +22
-4
lines changed
Formatters/Implementations Expand file tree Collapse file tree 7 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,10 @@ private extension HeaderFormatter {
114114 }
115115
116116 func headerFontSize( for type: Header . HeaderType , defaultSize: Float ? ) -> Float {
117+ if Configuration . useDefaultFont {
118+ return defaultSize!
119+ }
120+
117121 guard type == . none, let defaultSize = defaultSize else {
118122 return type. fontSize
119123 }
Original file line number Diff line number Diff line change @@ -30,8 +30,10 @@ open class PreFormatter: ParagraphAttributeFormatter {
3030
3131 newParagraphStyle. appendProperty ( HTMLPre ( with: representation) )
3232
33+ let defaultFont = attributes [ . font]
34+
3335 resultingAttributes [ . paragraphStyle] = newParagraphStyle
34- resultingAttributes [ . font] = monospaceFont
36+ resultingAttributes [ . font] = Configuration . useDefaultFont ? defaultFont : monospaceFont
3537
3638 return resultingAttributes
3739 }
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import Foundation
33public final class Configuration {
44
55 public static var headersWithBoldTrait = false
6+ public static var useDefaultFont = false
67
78 static var defaultBoldFormatter : AttributeFormatter {
89 get {
Original file line number Diff line number Diff line change @@ -178,6 +178,10 @@ open class TextView: UITextView {
178178 ///
179179 open var shouldNotifyOfNonUserChanges = true
180180
181+ /// If this is true the typing attributes will be recalculated when deleting backward
182+ ///
183+ open var shouldRecalculateTypingAttributesOnDeleteBackward = true
184+
181185 // MARK: - Customizable Input VC
182186
183187 private var customInputViewController : UIInputViewController ?
@@ -738,7 +742,9 @@ open class TextView: UITextView {
738742 evaluateRemovalOfSingleLineParagraphAttributesAfterSelectionChange ( )
739743 ensureRemovalOfParagraphAttributesWhenPressingBackspaceAndEmptyingTheDocument ( )
740744 ensureCursorRedraw ( afterEditing: deletedString. string)
741- recalculateTypingAttributes ( )
745+ if shouldRecalculateTypingAttributesOnDeleteBackward {
746+ recalculateTypingAttributes ( )
747+ }
742748 notifyTextViewDidChange ( )
743749 }
744750
Original file line number Diff line number Diff line change 1+ 1.19.7
2+ -------
3+ * Add variable to control whether typing attributes should be recalculated when deleting backward.
4+ * Allow using the default font for the PreFormatter/HeaderFormatter.
5+
161.19.6
27-------
38* Add support for Mark inline formatting.
Original file line number Diff line number Diff line change 11Pod ::Spec . new do |s |
22 s . name = 'WordPress-Aztec-iOS'
3- s . version = '1.19.6 '
3+ s . version = '1.19.7 '
44
55 s . summary = 'The native HTML Editor.'
66 s . description = <<-DESC
Original file line number Diff line number Diff line change 11Pod ::Spec . new do |s |
22 s . name = 'WordPress-Editor-iOS'
3- s . version = '1.19.6 '
3+ s . version = '1.19.7 '
44
55 s . summary = 'The WordPress HTML Editor.'
66 s . description = <<-DESC
You can’t perform that action at this time.
0 commit comments