clean-attrs
In Transforms
Eleventy transform that strips eleventy:ignore="" markers left on <img>
tags inside <picture> elements. The official
eleventyImageTransformPlugin only clears the attribute on bare <img>
elements; this transform finishes the job.
import {
createCleanAttrsTransform,
} from '@allons-y/dashly/transforms/clean-attrs';
createCleanAttrsTransform(options?)
Create the attribute-cleanup transform.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
options
(optional)
|
object |
||
options.attrs
(optional)
|
string[] |
Additional attribute names to strip. Defaults to ['eleventy:ignore']. |
Returns
(content: string) => string