fix: fix build errors

This commit is contained in:
jinhojang6
2025-06-17 03:30:21 +09:00
parent c1f1c17a06
commit 3458ce0e5f

View File

@@ -134,6 +134,20 @@ function updateMarkdownLinksToExcludeMD(content) {
return content.replace(regex, replaceLinks)
}
function replaceLocalImagePathsWithGitHubUrls(content) {
return content.replace(
/(?:\(|\s|])\/(status|vac)\/[^\s)]+\.(png|jpg|jpeg|gif)/g,
match => {
const path =
match.match(/\/(status|vac)\/[^\s)]+\.(png|jpg|jpeg|gif)/)?.[0] || ''
return match.replace(
path,
`https://github.com/vacp2p/rfc-index/blob/main${path}?raw=true`,
)
},
)
}
export function vacMarkdownToDocusaurusMarkdown(fileContent) {
let convertedContent = fileContent
@@ -157,6 +171,8 @@ export function vacMarkdownToDocusaurusMarkdown(fileContent) {
convertedContent = updateMarkdownLinksToExcludeMD(convertedContent)
convertedContent = replaceLocalImagePathsWithGitHubUrls(convertedContent)
return convertedContent
}