|
|
|
|
|
by jaytaylor
3674 days ago
|
|
library size is extremely compact
2.2k, seriously, can you imagine!
I wonder if I can do better than this, since it seems mostly a matter of a few regular expressions and then DOM manipulation?EDIT Reviewing the source code [0] the state-machine approach, when properly implemented can beat* [1] an equivalent RE performance-wise. It still may be interesting to see if the code size could substantially reduced this way. [0] https://github.com/asvd/microlight/blob/master/microlight.js * [1] Disclaimer: In my experience, and admittedly not using javascript. I have recently confirmed minimal hand-implemented state machines generally beating Regexp's in Golang. |
|