UziTech / marked-linkify-it

marked using linkify-it for urls
https://www.npmjs.com/package/marked-linkify-it
MIT License
2 stars 4 forks source link

Links with URL text are linkified #475

Closed jfx2006 closed 1 year ago

jfx2006 commented 1 year ago

Test script:

#!/usr/bin/env node

import { marked } from 'marked';
import markedLinkifyIt from 'marked-linkify-it';

const markedOptions = {
    gfm: true,
    pedantic: false,
    breaks: false,
  };

marked.setOptions(markedOptions);
marked.use(markedLinkifyIt({}, {}));

import 'marked/bin/marked';

Run the test script:

$ ./test/linkify_test.mjs /dev/stdin
[http://example1.com](http://example2.com)
<Ctrl-D>

Output:

<p><a href="http://example2.com"><a href="http://example1.com">http://example1.com</a></a></p>

Expected output should not linkify "http://example1.com".

For comparison markdown-it does render correctly:

$ ./node_modules/.bin/markdown-it
[http://example1.com](http://example2.com)

Output:

<p><a href="http://example2.com">http://example1.com</a></p>

And Github does as well...

http://example1.com

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 3.1.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket: