Releases: posthtml/posthtml-fetch
Releases · posthtml/posthtml-fetch
v1.2.1
This release updates dependencies and moves to CI from Travis to GitHub Actions.
- chore: update funding.yml 3c14805
- ci: remove travis eeb495d
- ci: add github workflow 3994111
- build(deps): bump got from 11.1.1 to 11.8.0 1d0570b
- build: update dev dependencies 1e0272f
- build(deps): bump posthtml-expressions from 1.4.0 to 1.6.2 5a46e0a
- build(deps): bump posthtml from 0.13.0 to 0.15.0 569d191
- build(deps): bump elliptic from 6.5.2 to 6.5.3 c3601b4
- build(deps): bump lodash from 4.17.15 to 4.17.19 79ed34b
v1.2.0
v1.1.1
v1.1.0
This release adds two new options.
plugins
You can now call other plugins that can run before or after the content is fetched:
const posthtml = require('posthtml')
const pf = require('posthtml-fetch')
posthtml()
.use(pf({
plugins: {
after(tree) {
// Your plugin implementation
},
before: [
tree => {
// Your plugin implementation
},
tree => {
// Your plugin implementation
}
]
}
}))
.process('<fetch url="https://example.test">{{ response }}</fetch>')
.then(result => {
console.log(result.html)
// => ...interpolated response from https://example.test
})
preserveTag
Type: boolean
Default: false
You can tell the plugin to preserve the <fetch>
tag:
const posthtml = require('posthtml')
const pf = require('posthtml-fetch')
posthtml()
.use(pf({
preserveTag: true
}))
.process('<fetch url="https://example.test">{{ response }}</fetch>')
.then(result => {
console.log(result.html)
// => <fetch url="https://example.test">...interpolated response from https://example.test</fetch>
})