check for rendered attribute

This commit is contained in:
Philipp Kühn
2020-10-21 23:35:12 +02:00
parent 6752d52541
commit 9fad9cd476
2 changed files with 4 additions and 2 deletions

View File

@@ -3,9 +3,10 @@ import { ExtensionAttribute } from '../types'
export default function getRenderedAttributes(node: Node, attributes: ExtensionAttribute[]) {
return attributes
.map(attribute => {
.filter(item => item.attribute.rendered)
.map(item => {
// TODO: fallback if renderHTML doesnt exist
return attribute.attribute.renderHTML(node.attrs)
return item.attribute.renderHTML(node.attrs)
})
.reduce((accumulator, value) => {
// TODO: add support for "class" merge