Skip to content

Commit a154ded

Browse files
authored
Merge pull request #16 from thmsmlr/patch-1
Include a common gotcha when using Code blocks
2 parents eb6053f + 4ffcd88 commit a154ded

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,17 @@ Most common block types are supported. We happily accept pull requests to add su
117117
| Checkbox | ❌ Missing | |
118118
| Table Of Contents | ❌ Missing | |
119119

120+
## Block Type Specific Caveats
121+
122+
When using a code block in your Notion page, `NotionRenderer` will use `prismjs` to detect the language of the code block.
123+
By default in most project, `prismjs` won't include all language packages in the minified build of your project.
124+
This tends to be an issue for those using `react-notion` in a `next.js` project.
125+
To ensure the programming language is correctly highlighted in production builds, one should explicitly imported into the project.
126+
127+
```jsx
128+
import 'prismjs/components/prism-{language}';
129+
```
130+
120131
## Credits
121132

122133
- [Tobias Lins](https://tobi.sh) – Idea, Code

0 commit comments

Comments
 (0)