premailex
premailex copied to clipboard
Move away from Regular Expression parsing of CSS
From #28:
I've been looking into building a CSS lexer and parser, and checked how Jason decodes JSON.
This ruby library is interesting too: https://github.com/rgrove/crass/blob/master/lib/crass/tokenizer.rb
And there's also this erlang project: https://github.com/acammack-r7/erlang-css
The way Jason does it is probably the better option, but it'll require time to get working. Not sure if I'll have the time available to fix this anytime soon. Any help/suggestions would be welcome.
Right now it's just a RegEx based parser. A tokenizer should be built instead.
I believe NimbleParsec is now the ideal way to build a tokenizer. Whenever I have the time I'll take a stab at it.