Skip to content

Support for inline uneditable/dynamic nodes #144

Description

@mpreziuso

First off, thanks for creating Svedit, it's a really great library! I appreciate how flexible it is and the thoughtful design decisions that went into it. I've been following it for a while, it's really cool work!

I was wondering if inlining uneditable/dynamic nodes was something on your roadmap. I'm thinking of cases like @user-mentions (where usernames may change) or references to other resources that may change over time and would be inlined in a paragraph – essentially content that shouldn't be hardcoded in the document because it needs to stay in sync with external data.

I tried different approaches and managed to get pretty far with a very basic implementation, but I'm clearly going against the grain, especially because I'm trying not to change the core Svedit files so that I can easily update them as you drop new features.

The main issue is that since the content I'm inserting is dynamic, I'm inlining the node but not inserting the content in the model. This pretty much works but breaks when deleting content that follows that node, since the offsets calculated from the SelectionRange will be out of sync with the character length.

Have you already thought about this use case? Do you have any suggestions for how to approach this, or is this something you'd consider adding native support for? I'm happy to share more details about my current implementation if that would be helpful!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions