Skip to content

Commit

Permalink
syntaxHighlighting bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dsoskey committed Apr 23, 2024
1 parent f61a193 commit 925a4ef
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/api/local/syntaxHighlighting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,25 @@ export const linkWrap = (env: Environment) => {
case "venn": {
const filter = env.content.match(/^@(\w+):?.*$/)[1];
const href = extensionDocs[filter];
env.tag = 'a';
env.attributes.href = href;
if (!href.startsWith("/")) {
env.attributes.target = '_blank'
env.attributes.rel = 'noreferrer noopener'
if (href) {
env.tag = 'a';
env.attributes.href = href;
if (!href.startsWith("/")) {
env.attributes.target = '_blank'
env.attributes.rel = 'noreferrer noopener'
}
}
break;
}
case "keyword": {
const href = syntaxDocs[env.content] ?? ""
env.tag = 'a'
env.attributes.href = href
if (!href.startsWith("/")) {
env.attributes.target = '_blank'
env.attributes.rel = 'noreferrer noopener'
const href = syntaxDocs[env.content]
if (href) {
env.tag = 'a';
env.attributes.href = href;
if (!href.startsWith("/")) {
env.attributes.target = '_blank'
env.attributes.rel = 'noreferrer noopener'
}
}
break;
}
Expand Down

0 comments on commit 925a4ef

Please sign in to comment.