Skip to content

Commit

Permalink
fix: exclude script tags
Browse files Browse the repository at this point in the history
  • Loading branch information
relliv committed Mar 26, 2022
1 parent e26fa7e commit 351c8da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egoistdeveloper/twcss-to-sass",
"version": "2.1.15",
"version": "2.1.16",
"description": "HTML template to SASS converter for TailwindCSS",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
4 changes: 3 additions & 1 deletion src/twcss-to-sass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ function filterHtmlData(nodeTree: IHtmlNode[], deepth = 0): IHtmlNode[] {
if (nodeTree.length > 0) {
// we do need to empty or doctype declaration
nodeTree = nodeTree.filter(
(x: IHtmlNode) => x.content !== ' ' && x.tagName != '!doctype'
(x: IHtmlNode) =>
x.content !== ' ' && x.tagName != '!doctype' && x.tagName != 'script'
)

nodeTree.forEach((node: IHtmlNode, index) => {
Expand Down Expand Up @@ -696,6 +697,7 @@ export function convertToSass(
htmlTreeResult = ''

if (sassTreeResult) {
// clean peer utility classes
sassTreeResult = sassTreeResult.replace(
/ peer-([a-z0-9]+):([a-z0-9-:\/]+)/gm,
''
Expand Down

0 comments on commit 351c8da

Please sign in to comment.