mishig HF Staff commited on
Commit
0d5b8d0
·
verified ·
1 Parent(s): dc592ad

Upload lib/wiki.ts with huggingface_hub

Browse files
Files changed (1) hide show
  1. lib/wiki.ts +2 -1
lib/wiki.ts CHANGED
@@ -101,7 +101,8 @@ export async function getPage(slug: string): Promise<WikiPage | null> {
101
 
102
  const processed = processWikilinks(content);
103
  const result = await remark().use(remarkGfm).use(remarkHtml, { allowDangerousHtml: true }).process(processed);
104
- const htmlWithVideos = processVideoEmbeds(result.toString());
 
105
 
106
  const title =
107
  (data.title as string) ||
 
101
 
102
  const processed = processWikilinks(content);
103
  const result = await remark().use(remarkGfm).use(remarkHtml, { allowDangerousHtml: true }).process(processed);
104
+ const htmlWithVideos = processVideoEmbeds(result.toString())
105
+ .replace(/<a href="(https?:\/\/[^"]+)"/g, '<a href="$1" target="_blank" rel="noopener noreferrer"');
106
 
107
  const title =
108
  (data.title as string) ||