Skip to content

Link Decorator– external vs. internal #22

@chrisheninger

Description

@chrisheninger

The current implementation of our Link decorator is as follows (majority is taken directly from the draftjs documentation):

this.decorator = new CompositeDecorator([linkDecorator]);

where linkDecorator is the following:
https://github.com/synapsestudios/draftjs-editor/blob/f033dd1402a484809c3c0a272e05642677079f89/src/decorators/link.jsx

On multiple projects– we've had issues with users needing a differentation between opening internal links (react-router Link) vs. external (a tag, target blank, rel noopener noreferrer). The most recent implementation involved creating a new link decorator, extending the draftjs editor, and overriding the default in the constructor.

I think it would be beneficial to provide an easier/out-of-the-box solution for the way we handle links.

cc @tdboone– as he was the most recent to implement an override at the project-level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementModification to an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions