danschultzer / premailex

Preflight for your HTML emails - inline styling and plain text.
MIT License
169 stars 19 forks source link

Move away from Regular Expression parsing of CSS #30

Open danschultzer opened 5 years ago

danschultzer commented 5 years ago

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 commented 9 months ago

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