File tree Expand file tree Collapse file tree
Aztec/Classes/Formatters/Implementations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,10 +68,11 @@ open class HeaderFormatter: ParagraphAttributeFormatter {
6868 resultingAttributes [ . paragraphStyle] = newParagraphStyle
6969
7070 if let font = attributes [ . font] as? UIFont {
71- let newFont = font. withSize ( CGFloat ( header. defaultFontSize) )
71+ var newFont = font. withSize ( CGFloat ( header. defaultFontSize) )
7272 if Configuration . headersWithBoldTrait {
73- resultingAttributes [ . font ] = newFont. modifyTraits ( . traitBold, enable: false )
73+ newFont = newFont. modifyTraits ( . traitBold, enable: false )
7474 }
75+ resultingAttributes [ . font] = newFont
7576 }
7677 resultingAttributes [ . headingRepresentation] = nil
7778 return resultingAttributes
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class HeaderFormatterTests: XCTestCase {
2828
2929 let removedAttrs = formatter. remove ( from: updatedAttrs)
3030 let removedFont = removedAttrs [ . font] as! UIFont
31- XCTAssert ( removedFont. pointSize == defaultFontSize)
31+ XCTAssertEqual ( removedFont. pointSize, defaultFontSize)
3232 }
3333
3434 /// Verifies that the Default Font is preserved whenever a Header Style is applied on top of an existant Header.
@@ -46,6 +46,6 @@ class HeaderFormatterTests: XCTestCase {
4646
4747 let removedAttrs = formatterH2. remove ( from: updatedH2Attrs)
4848 let removedFont = removedAttrs [ . font] as! UIFont
49- XCTAssert ( removedFont. pointSize == defaultFontSize)
49+ XCTAssertEqual ( removedFont. pointSize, defaultFontSize)
5050 }
5151}
You can’t perform that action at this time.
0 commit comments