Skip to content

Commit

Permalink
Merge pull request #1146 from maizzle/fix/pretty-newline-style
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Jan 14, 2024
2 parents 0c33efa + 5e923b3 commit d27219a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/transformers/prettify.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const reFormat = (html, config) => {
return html
.replace(/,\s*/g, ', ')
.replace(/(\s+style="\s+)([\s\S]*?)(\s+")/g, (match, p1, p2, p3) => {
const formattedStyle = p2.replace(/\s+/g, ' ').trim()
return p1.trim() + formattedStyle + p3.trim()
return p1.replace(/\n\s+?(style)/g, ' $1').trimEnd()
+ p2.replace(/\s+/g, ' ').trim()
+ p3.trim()
})
}

0 comments on commit d27219a

Please sign in to comment.