diff --git a/docs/helpers.md b/docs/helpers.md index 6bd8a069d..37be1d9e1 100644 --- a/docs/helpers.md +++ b/docs/helpers.md @@ -95,6 +95,7 @@ Only when you set both the `routerMode: 'history'` and `externalLinkTarget: '_se ### Resizing + ```md   @@ -121,6 +122,19 @@ Only when you set both the `routerMode: 'history'` and `externalLinkTarget: '_se  ``` +### Absolute Path + +```md + + + + +``` + + + + + ## Customise ID for headings ```md diff --git a/src/core/render/compiler/image.js b/src/core/render/compiler/image.js index 982e5e55e..2844a6263 100644 --- a/src/core/render/compiler/image.js +++ b/src/core/render/compiler/image.js @@ -3,7 +3,7 @@ import { isAbsolutePath, getPath, getParentPath } from '../../router/util'; export const imageCompiler = ({ renderer, contentBase, router }) => (renderer.image = (href, title, text) => { - let url = href; + let url = href.replace(/^\/+|^:/, ''); let attrs = []; const { str, config } = getAndRemoveConfig(title);