2019-11-19 04:29:29 +01:00
|
|
|
/**
|
|
|
|
* Completes the shorthand [api:Something] syntax to [api:Something](Something)
|
|
|
|
* @param html
|
|
|
|
*/
|
2020-02-12 04:32:55 +01:00
|
|
|
const cleanApiTags = (html: string): string => {
|
|
|
|
return html
|
|
|
|
.replace(
|
2019-11-19 01:55:33 +01:00
|
|
|
/\[api:(.*?)\]([^(])/g,
|
2020-02-12 04:32:55 +01:00
|
|
|
(_, query, next) => `<a href="api:${query}">${query}</a>${next}`
|
2019-11-12 23:14:12 +01:00
|
|
|
)
|
|
|
|
};
|
|
|
|
|
|
|
|
export default cleanApiTags;
|