DEV Community


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)

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:

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.

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:
Thanks again!

Forem Open with the Forem app