Skip to content

marks with rich attributes #1

Open
@jjallaire

Description

Noted the discussion about Automerge marks having a name and primitive value whereas Prosemirror marks can have arbitrary JS objects as attributes. The comments example illustrates how to store the richer attributes out of band and refer to them with an ID. However, I'm wondering if given the prevalence of extended attributes on marks (e.g. many markdown flavors including Pandoc allow attaching an id, classes, and keyvalue pairs to marks; links can have both an href and title, etc.) that richer storage should be supported in mark.value? There may be a good reason not to do this, just wanted to raise it as a possibility.

I am currently working around this by serializing mark attributes to JSON before setting into value (and reversing this on read). However, it seems like for the highest fidelity merging you would want to be able to read and write individual properties (one author might change the id whereas another adds a class, etc.).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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