diff --git a/src/mdast-process-images.js b/src/mdast-process-images.js index 9ed5ead..a97e738 100644 --- a/src/mdast-process-images.js +++ b/src/mdast-process-images.js @@ -39,7 +39,7 @@ export async function processImages(log, tree, mediaHandler, baseUrl) { visit(tree, (node) => { if (node.type === 'image') { const { url = '' } = node; - if (url.indexOf(':') < 0) { + if (url.indexOf(':') < 0 || url.startsWith('/')) { // eslint-disable-next-line no-param-reassign node.url = new URL(url, baseUrl).href; register(node); diff --git a/test/fixtures/images.html b/test/fixtures/images.html index 798c937..b721bfb 100644 --- a/test/fixtures/images.html +++ b/test/fixtures/images.html @@ -32,6 +32,9 @@