Skip to content

Commit

Permalink
fix: fix gfm urls after link (#2186)
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed Aug 23, 2021
1 parent 73c39ca commit e03b5c1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Tokenizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ function outputLink(cap, link, raw, lexer) {

if (cap[0].charAt(0) !== '!') {
lexer.state.inLink = true;
return {
const token = {
type: 'link',
raw,
href,
title,
text,
tokens: lexer.inlineTokens(text, [])
};
lexer.state.inLink = false;
return token;
} else {
return {
type: 'image',
Expand Down
3 changes: 3 additions & 0 deletions test/specs/new/autolink_after_link.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<p><a href="https://github.com">Github</a></p>

<p><a href="https://github.com">https://github.com</a></p>
6 changes: 6 additions & 0 deletions test/specs/new/autolink_after_link.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
gfm: true
---
[Github](https://github.com)

https://github.com

1 comment on commit e03b5c1

@vercel
Copy link

@vercel vercel bot commented on e03b5c1 Aug 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.