Open ekzyis opened 1 week ago
We used to do this. It made the bundle size HUGE for not much gain. It can probably be done efficiently with selective, dynamic imports.
A solution should use https://nextjs.org/docs/app/building-your-application/optimizing/bundle-analyzer to make sure it doesn't bloat the bundle.
Is your feature request related to a problem? Please describe.
Code blocks don't use syntax highlighting. This makes code hard to read.
Describe the solution you'd like
If you use ```[language] instead of simply ``` to start a code block, it should highlight the syntax as the selected language like Github does. Here with python as an example:
Describe alternatives you've considered
n/a
Additional context
We already use
react-syntax-highlighter
but we only uselanguage='text'
:https://github.com/stackernews/stacker.news/blob/78520b787b928756c81700ab5b3ac16170ac9084/components/text.js#L134-L136
However, it requires more than passing the language since if I manually set it to
python
, it does not do syntax highlighting.