Skip to content

Commit

Permalink
fix: 临时解决超链接和斜体语法冲突的问题,最终解决方案应该是AutoLink语法实现排他
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Feb 21, 2023
1 parent b0dfb53 commit 9d23c56
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/hooks/AutoLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,9 @@ export default class AutoLink extends SyntaxBase {
}
}
const processedURL = this.urlProcessor(url, 'autolink');
return `<a target="${this.openNewPage ? '_blank' : '_self'}" rel="nofollow" title="${$e(
url,
)}" href="${encodeURIOnce(processedURL)}">${$e(linkText)}</a>`;
return `<a target="${this.openNewPage ? '\\_blank' : '\\_self'}" rel="nofollow" title="${$e(url).replace(
/_/g,
'\\_',
)}" href="${encodeURIOnce(processedURL).replace(/_/g, '\\_')}">${$e(linkText).replace(/_/g, '\\_')}</a>`;
}
}

0 comments on commit 9d23c56

Please sign in to comment.