Skip to content

Extending Linkify with prefix and target config settings #174

@adrianmcli

Description

@adrianmcli

I wanted to get a better idea of how to contribute to a plugin so I decided to try to implement prefixes and target attributes to the Linkify plugin. Users will call the plugin like this:

const linkifyPlugin = createLinkifyPlugin({
  prefix: 'http://',
  target: '_blank',
});

And the plugin will check to see if the href already begins with the prefix. If it does not, it will be added onto the front. Also, the target is set to whatever the user has chosen, otherwise it is null.

This is my rough first attempt. I know I'll need to clean it all up before submitting it for a pull request. I guess I'm just posting here to get some feedback on how I should refactor this since there doesn't yet seem to be a "dev conventions" guide written out.

Have a look at my commit here: adrianmcli@2ea2413

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions