Skip to content

Commit

Permalink
refactor: prefer role none over presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Jun 24, 2023
1 parent bc1cd04 commit 979fe21
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/transformers/extraAttributes.js
Expand Up @@ -14,14 +14,20 @@ module.exports = async (html, config = {}, direct = false) => {
table: {
cellpadding: 0,
cellspacing: 0,
role: 'presentation'
role: 'none'
},
img: {
alt: ''
}
}

attributes = direct ? {...attributes, ...config} : (isObject(config.extraAttributes) ? {...attributes, ...config.extraAttributes} : attributes)
attributes = direct
? {...attributes, ...config}
: (
isObject(config.extraAttributes)
? {...attributes, ...config.extraAttributes}
: attributes
)

return posthtml([addAttributes({attributes})]).process(html, posthtmlOptions).then(result => result.html)
}

0 comments on commit 979fe21

Please sign in to comment.