Skip to content

Commit

Permalink
Fix relative doc link in HTML.
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Oct 25, 2023
1 parent e4af6ee commit 62141f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions feishu-pages/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ const fetchDocAndWriteFile = async (

// TODO: Replace link's node_token into slug
for (const node_token in slugMap) {
const re = new RegExp(`\\]\\(${node_token}\\)`, 'gm');
content = content.replace(re, `](${URL_PREFIX}${slugMap[node_token]})`);
// Replace Markdown link and HTML link
const re = new RegExp(`${node_token}`, 'gm');
const newLink = `${URL_PREFIX}${slugMap[node_token]}`;
content = content.replace(re, newLink);
}

const metaInfo = generateFileMeta(doc, doc.slug, doc.position);
Expand Down

0 comments on commit 62141f9

Please sign in to comment.