Skip to content

Allow customizing which inline styles are preserved #2489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
tjarvstrand opened this issue Feb 26, 2025 · 1 comment
Open
1 task done

Allow customizing which inline styles are preserved #2489

tjarvstrand opened this issue Feb 26, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@tjarvstrand
Copy link
Contributor

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.

@tjarvstrand tjarvstrand added the enhancement New feature or request label Feb 26, 2025
@CatHood0
Copy link
Collaborator

We probably need to make retain work more dynamically, so that it doesn't ignore custom attributes. I'll check it out when I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants