Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: apply automated fixes
  • Loading branch information
autofix-ci[bot] authored Nov 2, 2023
commit 457880f33bcf4b78125aa222bc241c0ea9ae5932
5 changes: 4 additions & 1 deletion utils/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ export function resolveMarkdownRelativeLinks(
}
// match a link (e.g. [./example](./example), will replace the link, not the text)
if (url) {
return match.replace(`(${path})`, `(${cdnBaseURL}/${path.replace(/^\.\//, "")})`);
return match.replace(
`(${path})`,
`(${cdnBaseURL}/${path.replace(/^\.\//, "")})`,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please double-check if we could fix/improve the regex above? generating new (${path}) seems hacky to replace while haven't tried it locally... Also what is a sample README URL we can test against?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, here some readme where there is the issue: #68 (comment)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the regexp to simplify code and avoid too many if.

);
}
return match.replace(path, `${cdnBaseURL}/${path.replace(/^\.\//, "")}`);
},
Expand Down