Skip to content

Conversation

dimaMachina
Copy link
Contributor

@dimaMachina dimaMachina requested a review from a team as a code owner July 1, 2023 11:32
@github-actions
Copy link

github-actions bot commented Jul 1, 2023

📦 Next.js Bundle Analysis for @graphprotocol/docs

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Comment on lines 32 to 53
visit(
tree,
[
{ type: 'mdxJsxTextElement', name: 'img' },
{ type: 'mdxJsxFlowElement', name: 'img' },
],
(node: any) => {
const attrs = node.attributes as { name: string; value: string }[]
const srcAttr = attrs.find((attr) => attr.name === 'src')!
if (srcAttr.value.includes('.gitbook/assets/')) {
srcAttr.value = srcAttr.value.replace(
/.*\.gitbook\/assets\//,
`https://raw.githubusercontent.com/${assetsBasePath}.gitbook/assets/`
)
}
}
)
visit(tree, 'image', (node) => {
if (node.url.includes('../assets/')) {
node.url = node.url.replace(/.*\.\.\/assets\//, `https://raw.githubusercontent.com/${assetsBasePath}assets/`)
}
})
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not really about "links"; should it go in a separate Remark plugin?

Copy link
Contributor

@benface benface left a comment

Choose a reason for hiding this comment

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

Left a nitpicky comment.

@dimaMachina dimaMachina merged commit 38ab966 into main Jul 7, 2023
@dimaMachina dimaMachina deleted the fix-remote-links2 branch July 7, 2023 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants