mirror of
https://github.com/vacp2p/rfc.vac.dev.git
synced 2026-01-09 16:07:54 -05:00
fix: fix build errors
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user