DEV Community

loading...

Discussion on: I Spent the Last Year Writing a Book About Software: Here's How I Did It (and What I Learned Along the Way)

Collapse
mandiwise profile image
Mandi Wise Author

Hi Davide,

Big disclaimer: this does not work 100% yet (there are some instances where the highlighting falls apart, particularly when things get deeply nested). But this is what I managed to adapt from the fcurella/jsx-lexer:

gist.github.com/mandiwise/452b23fd...

It's on my long-term to-do list to completely rewrite this lexer from the ground-up, but I don't have the bandwidth for it at the moment.

Collapse
undavide profile image
Davide Barranca

Hi Mandi,
so nice of you to share this. I've touched it just ever slightly to allow the use of dashes in the component name (e.g. <sp-button>), I've forked your gist here: gist.github.com/undavide/a225bd6fb...
Thanks again!