Fix api tag parsing

This commit is contained in:
Aaron Carlino 2020-02-12 16:32:55 +13:00
parent c50398b563
commit 87cbb04d9b
1 changed files with 4 additions and 3 deletions

View File

@ -2,10 +2,11 @@
* Completes the shorthand [api:Something] syntax to [api:Something](Something)
* @param html
*/
const cleanApiTags = (html: string): string => {
return html.replace(
const cleanApiTags = (html: string): string => {
return html
.replace(
/\[api:(.*?)\]([^(])/g,
(_, query, next) => `<a href="${query}">${query}</a>${next}`
(_, query, next) => `<a href="api:${query}">${query}</a>${next}`
)
};