Skip to content

[Feat] Add a remove formatting action to remove any attribute/attributes from selected text #496

@Lomedhi

Description

@Lomedhi

Is your feature request related to a problem? Please describe.
With a controller.document.format(); you are able to add an attribute to a specified index and length of characters , but are not able to remove attributes from specified text.

Even if you implement an undo function action that undoes the format, the Delta undo doesn’t catch the attribute change to undo and needs another document change in order to undo both the document change and the .format(); attribute addition.

Describe the solution you'd like
Ex.
controller.document.removeAttributes(index, length, [ParchmentAttribute.bold]);

Describe alternatives you've considered
Attempted to use replace function to text with all the attributes after removing the attribute you wanted to remove, but it requires a textSelection.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    basic editionIssue related to basic edition functionality

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions