premailex icon indicating copy to clipboard operation
premailex copied to clipboard

Move away from Regular Expression parsing of CSS

Open danschultzer opened this issue 5 years ago • 1 comments

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.

danschultzer avatar Nov 25 '18 17:11 danschultzer

I believe NimbleParsec is now the ideal way to build a tokenizer. Whenever I have the time I'll take a stab at it.

danschultzer avatar Nov 20 '23 13:11 danschultzer