fix: fix gfm urls after link (#2186)
This commit is contained in:
parent
73c39cab25
commit
e03b5c1f8d
@ -13,7 +13,7 @@ function outputLink(cap, link, raw, lexer) {
|
|||||||
|
|
||||||
if (cap[0].charAt(0) !== '!') {
|
if (cap[0].charAt(0) !== '!') {
|
||||||
lexer.state.inLink = true;
|
lexer.state.inLink = true;
|
||||||
return {
|
const token = {
|
||||||
type: 'link',
|
type: 'link',
|
||||||
raw,
|
raw,
|
||||||
href,
|
href,
|
||||||
@ -21,6 +21,8 @@ function outputLink(cap, link, raw, lexer) {
|
|||||||
text,
|
text,
|
||||||
tokens: lexer.inlineTokens(text, [])
|
tokens: lexer.inlineTokens(text, [])
|
||||||
};
|
};
|
||||||
|
lexer.state.inLink = false;
|
||||||
|
return token;
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
type: 'image',
|
type: 'image',
|
||||||
|
3
test/specs/new/autolink_after_link.html
Normal file
3
test/specs/new/autolink_after_link.html
Normal file
@ -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
test/specs/new/autolink_after_link.md
Normal file
6
test/specs/new/autolink_after_link.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
gfm: true
|
||||||
|
---
|
||||||
|
[Github](https://github.com)
|
||||||
|
|
||||||
|
https://github.com
|
Loading…
x
Reference in New Issue
Block a user