@@ -364,16 +364,13 @@ attributes from the `W3C Standard Proposal`_ are allowed.
364364 $framework->htmlSanitizer()
365365 ->sanitizer('app.post_sanitizer')
366366 // allow the <article > element and 2 attributes
367- ->allowElement('article')
368- ->attribute('class')
369- ->attribute('data-attr')
367+ ->allowElement('article', ['class', 'data-attr'])
370368
371369 // allow the <img > element and preserve the src attribute
372- ->allowElement('img')
373- ->attribute('src')
370+ ->allowElement('img', 'src')
374371
375372 // allow the <h1 > element with all safe attributes
376- ->allowElement('h1', '*' )
373+ ->allowElement('h1')
377374 ;
378375 };
379376
@@ -528,12 +525,10 @@ on all elements allowed *before this setting*.
528525 $framework->htmlSanitizer()
529526 ->sanitizer('app.post_sanitizer')
530527 // allow "src' on <iframe > elements
531- ->allowAttribute('src')
532- ->element('iframe')
528+ ->allowAttribute('src', ['iframe'])
533529
534530 // allow "data-attr" on all elements currently allowed
535- ->allowAttribute('data-attr')
536- ->element('*')
531+ ->allowAttribute('data-attr', '*')
537532 ;
538533 };
539534
@@ -620,12 +615,10 @@ This option allows you to disallow attributes that were allowed before.
620615 ->element('*')
621616
622617 // ...except for the <section > element
623- ->dropAttriute('data-attr')
624- ->element('section')
618+ ->dropAttribute('data-attr', ['section'])
625619
626620 // disallows "style' on any allowed element
627621 ->dropAttribute('style')
628- ->element('*')
629622 ;
630623 };
631624
@@ -640,7 +633,7 @@ This option allows you to disallow attributes that were allowed before.
640633 ->allowAttribute('data-attr')
641634
642635 // ...except for the <section> element
643- ->dropAttriute ('data-attr', ['section'])
636+ ->dropAttribute ('data-attr', ['section'])
644637
645638 // disallows "style' on any allowed element
646639 ->dropAttribute('style')
@@ -695,8 +688,7 @@ element (even if the original one didn't contain a ``rel`` attribute):
695688 return static function (FrameworkConfig $framework) {
696689 $framework->htmlSanitizer()
697690 ->sanitizer('app.post_sanitizer')
698- ->forceAttribute('a')
699- ->attribute('rel', 'noopener noreferrer')
691+ ->forceAttribute('a', 'rel', 'noopener noreferrer')
700692 ;
701693 };
702694
@@ -791,9 +783,7 @@ URLs of ``<a>`` elements:
791783
792784 // specifies the allowed URL schemes. If the URL has a different scheme, the
793785 // attribute will be dropped
794- ->allowedLinkScheme('http')
795- ->allowedLinkScheme('https')
796- ->allowedLinkScheme('mailto')
786+ ->allowedLinkSchemes(['http', 'https', 'mailto'])
797787
798788 // specifies the allowed hosts, the attribute will be dropped if the
799789 // URL contains a different host
@@ -907,9 +897,7 @@ the HTML sanitizer: ``src``, ``href``, ``lowsrc``, ``background`` and ``ping``.
907897
908898 // specifies the allowed URL schemes. If the URL has a different scheme, the
909899 // attribute will be dropped
910- ->allowedMediaScheme('http')
911- ->allowedMediaScheme('https')
912- ->allowedMediaScheme('mailto')
900+ ->allowedMediaSchemes(['http', 'https', 'mailto'])
913901
914902 // specifies the allowed hosts, the attribute will be dropped if the URL
915903 // contains a different host