Skip to content

Commit

Permalink
Use simplified regex until the parens issue is resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jun 13, 2017
1 parent 136a2f2 commit aca71b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
@@ -1,7 +1,9 @@
'use strict';
const urlRegex = require('url-regex');
// - const urlRegex = require('url-regex');
const escapeGoat = require('escape-goat');

const urlRegex = () => /(http(s)?(:\/\/))(www\.)?[a-zA-Z0-9-_.]+(\.[a-zA-Z0-9]{2,})([-a-zA-Z0-9:%_+.~#?&//=]*)/g;

module.exports = (input, options) => {
options = Object.assign({
attributes: {}
Expand Down
5 changes: 5 additions & 0 deletions test.js
Expand Up @@ -16,4 +16,9 @@ test(t => {
}),
'See <a href="https://sindresorhus.com" class="unicorn" target="_blank">https://sindresorhus.com</a>'
);

t.is(
m('[![Build Status](https://travis-ci.org/sindresorhus/caprine.svg?branch=master)](https://travis-ci.org/sindresorhus/caprine)'),
'[![Build Status](<a href="https://travis-ci.org/sindresorhus/caprine.svg?branch=master">https://travis-ci.org/sindresorhus/caprine.svg?branch=master</a>)](<a href="https://travis-ci.org/sindresorhus/caprine">https://travis-ci.org/sindresorhus/caprine</a>)'
);
});

0 comments on commit aca71b8

Please sign in to comment.