Skip to content

Commit

Permalink
!important中间可以有空格 fix #64
Browse files Browse the repository at this point in the history
  • Loading branch information
army8735 committed Mar 25, 2019
1 parent 7930177 commit 9d643af
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lexer/rule/CssRule.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions tests/csslexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@ describe('csslexer', function() {
expect(join(tokens)).to.eql(['p', '{', 'margin', ':', '0', '!important', '}']);
expect(type(tokens)).to.eql([21, 8, 10, 8, 4, 18, 8]);
});
it('! important', function() {
var lexer = homunculus.getLexer('css');
var tokens = lexer.parse('p{margin:0! important}');
expect(join(tokens)).to.eql(['p', '{', 'margin', ':', '0', '! important', '}']);
expect(type(tokens)).to.eql([21, 8, 10, 8, 4, 18, 8]);
});
it('!important out of {}', function() {
var lexer = homunculus.getLexer('css');
var tokens = lexer.parse('margin:0!important');
Expand Down
2 changes: 1 addition & 1 deletion web/lexer/rule/CssRule.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9d643af

Please sign in to comment.