sindresorhus / linkify-urls

Linkify URLs in a string
MIT License
160 stars 22 forks source link

urlRegex does't work in Safari, please fix #24

Closed ulmanss closed 5 years ago

ulmanss commented 5 years ago

urlRegex does't work in Safari. SyntaxError: Invalid regular expression: invalid group specifier name.

Problem in (?<!+)

Thnx.

sindresorhus commented 5 years ago

This module mainly targets Node.js, not the browser. It's up to you to transpile it with Babel if you want to use it in older browser. You can find a more detailed explanation here: https://github.com/sindresorhus/ama/issues/446

If you use Webpack, check out babel-engine-plugin, which transpiles only the dependencies that needs to be transpiled.

If you use Create React App, upgrade to Create React App v2. It supports automatic transpilation of dependencies, which will make this package just work.

vesamet commented 1 year ago

For those who stumble on this issue, the library LinkifyJs is a good alternative for all modern browsers. For Node.js project I would still go with sindresorhus solution.