diff --git a/html_sanitizer.rst b/html_sanitizer.rst
index 429e4feef5e..d5dbf99fa81 100644
--- a/html_sanitizer.rst
+++ b/html_sanitizer.rst
@@ -364,16 +364,13 @@ attributes from the `W3C Standard Proposal`_ are allowed.
$framework->htmlSanitizer()
->sanitizer('app.post_sanitizer')
// allow the element and 2 attributes
- ->allowElement('article')
- ->attribute('class')
- ->attribute('data-attr')
+ ->allowElement('article', ['class', 'data-attr'])
// allow the
element and preserve the src attribute
- ->allowElement('img')
- ->attribute('src')
+ ->allowElement('img', 'src')
// allow the