File tree Expand file tree Collapse file tree 2 files changed +28
-23
lines changed Expand file tree Collapse file tree 2 files changed +28
-23
lines changed Original file line number Diff line number Diff line change 1+ import { BlockNoteSchema , createCodeBlockSpec } from "@blocknote/core" ;
12import "@blocknote/core/fonts/inter.css" ;
23import { BlockNoteView } from "@blocknote/mantine" ;
34import "@blocknote/mantine/style.css" ;
45import { useCreateBlockNote } from "@blocknote/react" ;
56// This packages some of the most used languages in on-demand bundle
67import { codeBlock } from "@blocknote/code-block" ;
7- import { BlockNoteSchema , createCodeBlockSpec } from "@blocknote/core" ;
88
99export default function App ( ) {
1010 // Creates a new editor instance.
Original file line number Diff line number Diff line change 1+ import { BlockNoteSchema , createCodeBlockSpec } from "@blocknote/core" ;
12import "@blocknote/core/fonts/inter.css" ;
23import { BlockNoteView } from "@blocknote/mantine" ;
34import "@blocknote/mantine/style.css" ;
@@ -8,29 +9,33 @@ import { createHighlighter } from "./shiki.bundle";
89export default function App ( ) {
910 // Creates a new editor instance.
1011 const editor = useCreateBlockNote ( {
11- codeBlock : {
12- indentLineWithTab : true ,
13- defaultLanguage : "typescript" ,
14- supportedLanguages : {
15- typescript : {
16- name : "TypeScript" ,
17- aliases : [ "ts" ] ,
18- } ,
19- javascript : {
20- name : "JavaScript" ,
21- aliases : [ "js" ] ,
22- } ,
23- vue : {
24- name : "Vue" ,
25- } ,
26- } ,
27- // This creates a highlighter, it can be asynchronous to load it afterwards
28- createHighlighter : ( ) =>
29- createHighlighter ( {
30- themes : [ "dark-plus" , "light-plus" ] ,
31- langs : [ ] ,
12+ schema : BlockNoteSchema . create ( ) . extend ( {
13+ blockSpecs : {
14+ codeBlock : createCodeBlockSpec ( {
15+ indentLineWithTab : true ,
16+ defaultLanguage : "typescript" ,
17+ supportedLanguages : {
18+ typescript : {
19+ name : "TypeScript" ,
20+ aliases : [ "ts" ] ,
21+ } ,
22+ javascript : {
23+ name : "JavaScript" ,
24+ aliases : [ "js" ] ,
25+ } ,
26+ vue : {
27+ name : "Vue" ,
28+ } ,
29+ } ,
30+ // This creates a highlighter, it can be asynchronous to load it afterwards
31+ createHighlighter : ( ) =>
32+ createHighlighter ( {
33+ themes : [ "dark-plus" , "light-plus" ] ,
34+ langs : [ ] ,
35+ } ) ,
3236 } ) ,
33- } ,
37+ } ,
38+ } ) ,
3439 initialContent : [
3540 {
3641 type : "codeBlock" ,
You can’t perform that action at this time.
0 commit comments