posthtml-content icon indicating copy to clipboard operation
posthtml-content copied to clipboard

Support multiple attributes on a node

Open cossssmin opened this issue 1 year ago • 0 comments

Using multiple attributes to transform contents doesn't work right now:

<div uppercase append=" - nice movie">fubar</div>
import content from 'posthtml-content'

const {html} = await posthtml(content({
    uppercase: content => content.toUpperCase(),
    append: (content, attribute) => content + attribute
  })).process(sourceHtml)

Not really sure what the result should be:

<div>FUBAR - NICE MOVIE</div>

or:

<div>FUBAR - nice movie</div>

cossssmin avatar Jan 08 '24 16:01 cossssmin