Skip to content

Commit

Permalink
Revert "[FIX] base64 url in string is now working (#403)" (#416)
Browse files Browse the repository at this point in the history
This reverts commit 65015ee.
  • Loading branch information
cristianbote committed Jan 13, 2022
1 parent 999cb83 commit 920ce47
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
30 changes: 0 additions & 30 deletions src/core/__tests__/astish.test.js
Expand Up @@ -201,34 +201,4 @@ describe('astish', () => {
}
});
});

it('should handle css string values', () => {
expect(
astish(`
color: white;
padding: 1em;
background-image: url("data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7");
`)
).toEqual({
color: 'white',
padding: '1em',
'background-image': `url("data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7")`
});
});

it('should work without last semicolon', () => {
expect(
astish(`
h1 {
color: white;
padding: 1em
}
`)
).toEqual({
h1: {
color: 'white',
padding: '1em'
}
});
});
});
2 changes: 1 addition & 1 deletion src/core/astish.js
@@ -1,4 +1,4 @@
let newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^{};])+)(?=[;}])|([^;}{]*?) *{)|(}\s*)/g;
let newRule = /(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g;
let ruleClean = /\/\*[^]*?\*\/|\s\s+|\n/g;

/**
Expand Down

1 comment on commit 920ce47

@vercel
Copy link

@vercel vercel bot commented on 920ce47 Jan 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.