newTokens.push(textToken);
}
- // Determine the new href
let href;
if (match[0].startsWith("!")) {
href = "/c/" + match[0].substring(1);
href = "/c/" + match[0].substring(3);
} else {
href = match[0];
- }
-
- if (match[0].startsWith("/u/")) {
- linkClass = "user-link";
+ if (match[0].startsWith("/u/")) {
+ linkClass = "user-link";
+ }
}
const linkOpenToken = new state.Token("link_open", "a", 1);
newTokens.push(textToken);
}
- // Replace the original token with the new tokens
inlineTokens.splice(j, 1, ...newTokens);
}
}
.use(markdown_it_footnote)
.use(markdown_it_html5_embed, html5EmbedConfig)
.use(markdown_it_container, "spoiler", spoilerConfig)
- .use(localCommunityLinkParser);
+ .use(localInstanceLinkParser);
// .use(markdown_it_emoji, {
// defs: emojiDefs,
// });
.use(markdown_it_footnote)
.use(markdown_it_html5_embed, html5EmbedConfig)
.use(markdown_it_container, "spoiler", spoilerConfig)
- .use(localCommunityLinkParser)
+ .use(localInstanceLinkParser)
// .use(markdown_it_emoji, {
// defs: emojiDefs,
// })