Skip to content

Commit fc279aa

Browse files
authored
Merge pull request #1347 from wordpress-mobile/release/1.19.7
Release 1.19.7
2 parents bd01a63 + 156cb9e commit fc279aa

File tree

7 files changed

+22
-4
lines changed

7 files changed

+22
-4
lines changed

Aztec/Classes/Formatters/Implementations/HeaderFormatter.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

Aztec/Classes/Formatters/Implementations/PreFormatter.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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
}

Aztec/Classes/TextKit/Configuration.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Foundation
33
public final class Configuration {
44

55
public static var headersWithBoldTrait = false
6+
public static var useDefaultFont = false
67

78
static var defaultBoldFormatter: AttributeFormatter {
89
get {

Aztec/Classes/TextKit/TextView.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
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+
16
1.19.6
27
-------
38
* Add support for Mark inline formatting.

WordPress-Aztec-iOS.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::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

WordPress-Editor-iOS.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::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

0 commit comments

Comments
 (0)