Skip to content

Commit

Permalink
cont.
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhang-gh committed Nov 8, 2023
1 parent 04ca329 commit 6276cf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/print.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async function print(type: string, uri?: Uri, outFolder?: string) {
const hrefRegex = /(<a[^>]+href=")([^"]+)("[^>]*>)/g; // Match '<a...href="..."...>'
body = body.replace(hrefRegex, function (_, g1, g2, g3) {
if ((g2.endsWith('.md') || g2.includes('.md#')) && !(g2.includes('github.com') && g2.includes('blob'))) {
return `${g1}${g2.replace(/\.md$/, '.html')}${g3}`;
return `${g1}${g2.replace(/\.md$/, '.html').replace(/\.md#/, '.html#')}${g3}`;
} else {
return _;
}
Expand Down

0 comments on commit 6276cf5

Please sign in to comment.