We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug The syntax highlighting in code blocks is not working properly when I add initial codeblock content with multiple lines.
To Reproduce add Initial codeblock content with multiple lines to the editor
Example component where the content comes from the initialContent prop
"use client"; import React from "react"; import { BlockNoteSchema, defaultBlockSpecs, PartialBlock } from "@blocknote/core"; import { useCreateBlockNote } from "@blocknote/react"; import "@blocknote/core/fonts/inter.css"; import { BlockNoteView } from "@blocknote/mantine"; import "@blocknote/mantine/style.css"; import { useTheme } from "next-themes"; interface ViewerProps { initialContent?: string; } const schema = BlockNoteSchema.create({ blockSpecs: { // Adds all default blocks. ...defaultBlockSpecs }, }); const Viewer: React.FC<ViewerProps> = ({ initialContent }) => { const { theme } = useTheme() const editor = useCreateBlockNote({ schema, initialContent: initialContent ? (JSON.parse(initialContent) as PartialBlock[]) : undefined, }); return ( <div className="-mx-[54px] my-4"> <BlockNoteView editor={editor} editable={false} onChange={() => {}} theme={theme as "light" | "dark"} /> </div> ); }; export default Viewer;
Misc
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
The syntax highlighting in code blocks is not working properly when I add initial codeblock content with multiple lines.
To Reproduce
add Initial codeblock content with multiple lines to the editor
Example component where the content comes from the initialContent prop
Misc
The text was updated successfully, but these errors were encountered: