Skip to content

Replacing Top Document Node #1912

@Urchmaney

Description

@Urchmaney

Hi Blocknote team,

Thanks for the amazing work on this library. it’s been a pleasure building with it!

While implementing a custom feature, I needed to make a small change to the document node and wanted to replace it with a modified version. In the process, I noticed that the code assumes the top node is schema.nodes.doc. One place I saw the code is in the BlockNoteTipTapEditor file to update the createAndFill method.

However, ProseMirror provides a schema.topNode property, which would allow more flexibility for those customizing the schema, especially when the top-level node isn’t doc.

Would it make sense to use schema.topNode instead of schema.nodes.doc ? This change would allow advanced users to safely modify or replace the top node in more dynamic ways.

Not sure if this was a design decision, but happy to discuss or submit a PR if it’s a fit!

Thanks again

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions