Skip to content

Allow customizing which inline styles are preserved #2489

Open
@tjarvstrand

Description

@tjarvstrand

Have you checked for an existing issue?

Use case

Hi,

We are adding commenting functionality on top of flutter-quill. This works by a user selecting a section of text and adding a comment. Afterwards we'd like to highlight that part of the text to make it visible to other users that there's a comment there. We'd like this formatting to be "sticky", i.e. if you type inside a section of text that has a comment, the commented area should expand to include the newly typed text.

Basically, we'd just need to add an additional attribute to the Attribute.inlineKeys used by the current PreserveInlineStylesRule but with the current implementation this is not possible without reimplementing the entire class which isn't very future-proof.

Proposal

I would like to be able to add custom styles/attributes to the list of inline attributes that are preserved by the PreserveInlineStyles rule, either through parameter or by subclassing and overriding the list of keys.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions