Skip to content

Commit

Permalink
fix: return tree from prettify transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Aug 28, 2024
1 parent 43a1d76 commit 1d15fc5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/transformers/prettify.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import pretty from 'pretty'
import posthtml from 'posthtml'
import { defu as merge } from 'defu'
import { render } from 'posthtml-render'
import { parser as parse } from 'posthtml-parser'
import posthtmlConfig from '../posthtml/defaultConfig.js'

const posthtmlPlugin = (options = {}) => tree => {
Expand All @@ -14,7 +15,7 @@ const posthtmlPlugin = (options = {}) => tree => {

const config = merge(options, defaultConfig)

return pretty(render(tree), config)
return parse(pretty(render(tree), config), posthtmlConfig)
}

export default posthtmlPlugin
Expand Down

0 comments on commit 1d15fc5

Please sign in to comment.