github udecode/plate @udecode/plate-code-block@46.0.0

latest releases: @udecode/plate-selection@46.0.4, @udecode/plate-utils@46.0.4, @udecode/plate@46.0.4...
2 days ago

Major Changes

  • #4122 by @zbeyens – Migrated from prismjs to highlight.js + lowlight for syntax highlighting.

    • Fix highlighting multi-lines tokens. Before, line tokens were computed line by line. Now, it's computed once for the whole block.
    • Bundle size much lower.
    • CodeBlockPlugin: remove prism option. Use lowlight option instead:
    import { all, createLowlight } from 'lowlight';
    
    const lowlight = createLowlight(all);
    
    CodeBlockPlugin.configure({
      options: {
        lowlight,
      },
    });
    • New option: defaultLanguage
    • Remove syntax option. Just omit lowlight option to disable syntax highlighting.
    • Remove syntaxPopularFirst option. Control this behavior in your own components.
    • Fix pasting code inside code blocks.
    • Remove useCodeBlockCombobox, useCodeBlockElement, useCodeSyntaxLeaf, useToggleCodeBlockButton. The logic has been moved to the components.

Don't miss a new plate release

NewReleases is sending notifications on new releases.