Skip to content

Commit

Permalink
Merge pull request #23 from PeculiarVentures/fix-parsing-link_with-ro…
Browse files Browse the repository at this point in the history
…und-brackets

Update regex for link
  • Loading branch information
apilguk authored Aug 31, 2018
2 parents 7041bd9 + a02df2b commit c01577b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/bundler/docs/inline_parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const inlineRules = {
autolink: /^<([^ >]+(@|:\/)[^ >]+)>/,
url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,
tag: /^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,
link: /^!?\[(inside)\]\(href\)/,
link: /^!?\[(inside)\]\((href)\)+/,
reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/,
nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
Expand All @@ -54,7 +54,7 @@ const inlineRules = {

function prepareRegexp() {
inlineRules._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;
inlineRules._href = /\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;
inlineRules._href = /\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\)*\s*/;

inlineRules.link = replace(inlineRules.link)('inside', inlineRules._inside)('href', inlineRules._href)();

Expand Down Expand Up @@ -165,7 +165,7 @@ class InlineLexer {
this.inLink = true;
result.push(this.outputLink(cap, {
href: cap[2],
title: cap[3],
title: cap[2],
}) );
this.inLink = false;
continue;
Expand Down

0 comments on commit c01577b

Please sign in to comment.