polarsource / polar

Polar is the best funding & monetization platform for developers. From first donation to IPO.
https://polar.sh
Apache License 2.0
1.57k stars 53 forks source link

Missing languages in client-side code highlighter #3622

Closed eval closed 1 month ago

eval commented 1 month ago

A markdown code block won't have syntax highlighting when previewing a post. For published articles it's shown correctly.

frankie567 commented 1 month ago

Hey @eval 👋

Thank you for reporting; however, I don't experience the bug you describe.

Capture d’écran 2024-07-09 à 15 19 17

Could you share the post (or the faulty part) that provokes the issue?

eval commented 1 month ago

Thanks for checking @frankie567 It's seems to be specifically for clojure code blocks e.g. from this post: https://polar.sh/eval/posts/named-capturing-groups-in-clojure.

So the code in the post looks differently than before, and in preview mode no highlighting is visible...

frankie567 commented 1 month ago

Ah ok, I understand now :) We're using a light bundle of Shiki for client-side highlighting, which probably doesn't embed Clojure. The post page is server-side rendered so we're able to load languages on demand — that's why it works there.

I'll see what I can do 👍