shikijs / twoslash

You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples
https://shikijs.github.io/twoslash/
MIT License
1.08k stars 54 forks source link

Better error messaging when Fenceparser throws #101

Closed orta closed 3 years ago

orta commented 3 years ago

Aye, but where?

Screen Shot 2021-08-01 at 8 08 57 PM
orta commented 3 years ago
Screen Shot 2021-08-01 at 8 14 35 PM
frencojobs commented 3 years ago

I'll make fenceparser throw with the index of the error within the meta string, but twoslash has to try-catch that and add a line number because fenceparser doesn't have the line number data.

orta commented 3 years ago

Yeah, I think it's definitely Twoslash's responsibility to show the error message via a try catch. It will have enough information to show the full fence meta on it's own too - so you might not need to do anything inside fenceparser