Commit 68964e3
committed
Merge #136: feat(highlight): integrate highlight.js for improved code highlighting
4fef01a feat(highlight): integrate highlight.js for improved code highlighting (Graeme Byrne)
Pull request description:
feat(CodeBlock): integrate highlight.js for code syntax highlighting
- Added `highlight.js` to the CodeBlock component for syntax highlighting of code snippets.
- Imported the `atom-one-dark` theme for code styling.
- Implemented a `normalizeIndentation` function to ensure consistent indentation across code blocks by trimming excess spaces.
- Introduced a `processCodeForDisplay` function to replace escaped newline characters (`\n`) with actual newlines for better formatting.
- Modified the `code` prop to support the updated logic for normalizing and displaying code with syntax highlighting.
- Updated the rendering of code content with `hljs.highlight` to highlight the code based on the specified language.
These changes improve the readability and appearance of code snippets within the component by leveraging syntax highlighting and indentation normalization as mentioned in [#52](#52).
ACKs for top commit:
josecelano:
ACK 4fef01a
Tree-SHA512: 99e43ccf58ab94c6617dad8426a6f3b6de0c6e6f8d49191d3707099a6a0384454b3b8115f5da59ae86130962dafe15a631b4757456dc86e30be25a428a31d095File tree
27 files changed
+1360
-1253
lines changed- src
- lib
- components
- molecules
- singletons
- scss
- routes/blog
27 files changed
+1360
-1253
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| |||
0 commit comments