Skip to content

Commit

Permalink
feat: Add support for `` inside of Marked Link Brackets (#1091)
Browse files Browse the repository at this point in the history
  • Loading branch information
forivall committed Feb 28, 2020
1 parent 07fb1ce commit 1ec2fb8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/output/plugins/MarkedLinksPlugin.ts
Expand Up @@ -49,8 +49,9 @@ export class MarkedLinksPlugin extends ContextAwareRendererComponent {
*/
private replaceBrackets(text: string): string {
return text.replace(this.brackets, (match: string, content: string): string => {
const split = MarkedLinksPlugin.splitLinkText(content);
return this.buildLink(match, split.target, split.caption);
const monospace = content[0] === '`' && content[content.length - 1] === '`';
const split = MarkedLinksPlugin.splitLinkText(monospace ? content.slice(1, -1) : content);
return this.buildLink(match, split.target, split.caption, monospace);
});
}

Expand Down

0 comments on commit 1ec2fb8

Please sign in to comment.