FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: render image in absolute path · docsifyjs/docsify@e221023 · GitHub

Repository navigation

Commit e221023

Browse files
committed
fix: render image in absolute path
1 parent 3c9b3d9 commit e221023

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎docs/helpers.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Only when you set both the `routerMode: 'history'` and `externalLinkTarget: '_se
9595

9696
### Resizing
9797

98+
9899
```md
99100
![logo](https://docsify.js.org/_media/icon.svg ':size=WIDTHxHEIGHT')
100101
![logo](https://docsify.js.org/_media/icon.svg ':size=50x100')
@@ -121,6 +122,19 @@ Only when you set both the `routerMode: 'history'` and `externalLinkTarget: '_se
121122
![logo](https://docsify.js.org/_media/icon.svg ':id=someCssId')
122123
```
123124

125+
### Absolute Path
126+
127+
```md
128+
129+
![logo](:docs/_media/icon.svg 'with :')
130+
![logo](//docs/_media/icon.svg 'with //')
131+
132+
```
133+
134+
![logo](:docs/_media/icon.svg 'with :')
135+
136+
![logo](//docs/_media/icon.svg 'with //')
137+
124138
## Customise ID for headings
125139

126140
```md

‎src/core/render/compiler/image.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { isAbsolutePath, getPath, getParentPath } from '../../router/util';
33

44
export const imageCompiler = ({ renderer, contentBase, router }) =>
55
(renderer.image = (href, title, text) => {
6-
let url = href;
6+
let url = href.replace(/^\/+|^:/, '');
77
let attrs = [];
88

99
const { str, config } = getAndRemoveConfig(title);

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL