@@ -12,7 +12,7 @@ import XCTest
1212final class HTMLElementMarkupComponentMarkupStyleVisitorTests : XCTestCase {
1313
1414 func testDefaultStyleByDefault( ) {
15- let visitor = HTMLElementMarkupComponentMarkupStyleVisitor ( policy: . respectMarkupStyleFromCode, components: [ ] , styleAttributes: [ ] , rootStyle: nil )
15+ let visitor = HTMLElementMarkupComponentMarkupStyleVisitor ( policy: . respectMarkupStyleFromCode, components: [ ] , styleAttributes: [ ] , classAttributes : [ ] , idAttributes : [ ] , rootStyle: nil )
1616
1717 let result = visitor. visit ( markup: HeadMarkup ( level: . h1) )
1818 XCTAssertEqual ( result? . font. size, MarkupStyle . h1. font. size)
@@ -21,7 +21,7 @@ final class HTMLElementMarkupComponentMarkupStyleVisitorTests: XCTestCase {
2121 func testDefaultStyleByCustomStyle( ) {
2222 let markup = InlineMarkup ( )
2323 let customStyle = MarkupStyle ( font: . init( size: 99 ) )
24- let visitor = HTMLElementMarkupComponentMarkupStyleVisitor ( policy: . respectMarkupStyleFromCode, components: [ . init( markup: markup, value: . init( tag: . init( tagName: H1_HTMLTagName ( ) , customStyle: customStyle) , tagAttributedString: NSAttributedString ( string: " <span>test</span> " ) , attributes: [ : ] ) ) ] , styleAttributes: [ ] , rootStyle: nil )
24+ let visitor = HTMLElementMarkupComponentMarkupStyleVisitor ( policy: . respectMarkupStyleFromCode, components: [ . init( markup: markup, value: . init( tag: . init( tagName: H1_HTMLTagName ( ) , customStyle: customStyle) , tagAttributedString: NSAttributedString ( string: " <span>test</span> " ) , attributes: [ : ] ) ) ] , styleAttributes: [ ] , classAttributes : [ ] , idAttributes : [ ] , rootStyle: nil )
2525
2626 let result = visitor. visit ( markup: markup)
2727 XCTAssertEqual ( result? . font. size, customStyle. font. size)
@@ -30,15 +30,15 @@ final class HTMLElementMarkupComponentMarkupStyleVisitorTests: XCTestCase {
3030 func testDefaultStyleShouldOverrideByCustomStyle( ) {
3131 let markup = HeadMarkup ( level: . h1)
3232 let customStyle = MarkupStyle ( font: . init( size: 99 ) )
33- let visitor = HTMLElementMarkupComponentMarkupStyleVisitor ( policy: . respectMarkupStyleFromCode, components: [ . init( markup: markup, value: . init( tag: . init( tagName: H1_HTMLTagName ( ) , customStyle: customStyle) , tagAttributedString: NSAttributedString ( string: " <h1>test</h1> " ) , attributes: [ : ] ) ) ] , styleAttributes: [ ] , rootStyle: nil )
33+ let visitor = HTMLElementMarkupComponentMarkupStyleVisitor ( policy: . respectMarkupStyleFromCode, components: [ . init( markup: markup, value: . init( tag: . init( tagName: H1_HTMLTagName ( ) , customStyle: customStyle) , tagAttributedString: NSAttributedString ( string: " <h1>test</h1> " ) , attributes: [ : ] ) ) ] , styleAttributes: [ ] , classAttributes : [ ] , idAttributes : [ ] , rootStyle: nil )
3434
3535 let result = visitor. visit ( markup: markup)
3636 XCTAssertEqual ( result? . font. size, customStyle. font. size)
3737 }
3838
3939 func testDefaultStyleShouldOverrideByStyleAttributed( ) {
4040 let markup = HeadMarkup ( level: . h1)
41- let visitor = HTMLElementMarkupComponentMarkupStyleVisitor ( policy: . respectMarkupStyleFromCode, components: [ . init( markup: markup, value: . init( tag: . init( tagName: H1_HTMLTagName ( ) ) , tagAttributedString: NSAttributedString ( string: " <h1>test</h1> " ) , attributes: [ " style " : " font-size:99pt " ] ) ) ] , styleAttributes: [ FontSizeHTMLTagStyleAttribute ( ) ] , rootStyle: nil )
41+ let visitor = HTMLElementMarkupComponentMarkupStyleVisitor ( policy: . respectMarkupStyleFromCode, components: [ . init( markup: markup, value: . init( tag: . init( tagName: H1_HTMLTagName ( ) ) , tagAttributedString: NSAttributedString ( string: " <h1>test</h1> " ) , attributes: [ " style " : " font-size:99pt " ] ) ) ] , styleAttributes: [ FontSizeHTMLTagStyleAttribute ( ) ] , classAttributes : [ ] , idAttributes : [ ] , rootStyle: nil )
4242
4343 let result = visitor. visit ( markup: markup)
4444 XCTAssertEqual ( result? . font. size, 99 )
@@ -47,7 +47,7 @@ final class HTMLElementMarkupComponentMarkupStyleVisitorTests: XCTestCase {
4747 func testDefaultStylePolicyRespectMarkupStyleFromCode( ) {
4848 let markup = HeadMarkup ( level: . h1)
4949 let customStyle = MarkupStyle ( font: . init( size: 109 ) )
50- let visitor = HTMLElementMarkupComponentMarkupStyleVisitor ( policy: . respectMarkupStyleFromCode, components: [ . init( markup: markup, value: . init( tag: . init( tagName: H1_HTMLTagName ( ) , customStyle: customStyle) , tagAttributedString: NSAttributedString ( string: " <h1>test</h1> " ) , attributes: [ " style " : " font-size:99pt " ] ) ) ] , styleAttributes: [ FontSizeHTMLTagStyleAttribute ( ) ] , rootStyle: nil )
50+ let visitor = HTMLElementMarkupComponentMarkupStyleVisitor ( policy: . respectMarkupStyleFromCode, components: [ . init( markup: markup, value: . init( tag: . init( tagName: H1_HTMLTagName ( ) , customStyle: customStyle) , tagAttributedString: NSAttributedString ( string: " <h1>test</h1> " ) , attributes: [ " style " : " font-size:99pt " ] ) ) ] , styleAttributes: [ FontSizeHTMLTagStyleAttribute ( ) ] , classAttributes : [ ] , idAttributes : [ ] , rootStyle: nil )
5151
5252 let result = visitor. visit ( markup: markup)
5353 XCTAssertEqual ( result? . font. size, customStyle. font. size)
@@ -56,7 +56,7 @@ final class HTMLElementMarkupComponentMarkupStyleVisitorTests: XCTestCase {
5656 func testDefaultStylePolicyRespectMarkupStyleFromHTMLStyleAttribute( ) {
5757 let markup = HeadMarkup ( level: . h1)
5858 let customStyle = MarkupStyle ( font: . init( size: 109 ) )
59- let visitor = HTMLElementMarkupComponentMarkupStyleVisitor ( policy: . respectMarkupStyleFromHTMLStyleAttribute, components: [ . init( markup: markup, value: . init( tag: . init( tagName: H1_HTMLTagName ( ) , customStyle: customStyle) , tagAttributedString: NSAttributedString ( string: " <h1>test</h1> " ) , attributes: [ " style " : " font-size:99pt " ] ) ) ] , styleAttributes: [ FontSizeHTMLTagStyleAttribute ( ) ] , rootStyle: nil )
59+ let visitor = HTMLElementMarkupComponentMarkupStyleVisitor ( policy: . respectMarkupStyleFromHTMLStyleAttribute, components: [ . init( markup: markup, value: . init( tag: . init( tagName: H1_HTMLTagName ( ) , customStyle: customStyle) , tagAttributedString: NSAttributedString ( string: " <h1>test</h1> " ) , attributes: [ " style " : " font-size:99pt " ] ) ) ] , styleAttributes: [ FontSizeHTMLTagStyleAttribute ( ) ] , classAttributes : [ ] , idAttributes : [ ] , rootStyle: nil )
6060
6161 let result = visitor. visit ( markup: markup)
6262 XCTAssertEqual ( result? . font. size, 99 )
0 commit comments