Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mkdp_images_path_as_root (resolves #651) #671

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PaulBreugnot
Copy link

As suggested in #651, g:mkdp_images_path_as_root can now be set to 1 to resolve absolute image paths against g:mkdp_images_path.

Example:

![Custom image](/path/to/image.png)

with let g:mkdp_images_path = /home/user/.markdown_images.

If g:mkdp_images_path_as_root = 0 (default), then the image path is interpreted as an absolute linux path, starting at the root of the system.

If g:mkdp_images_path_as_root = 1, the path is interpreted as /home/user/.markdown_images/path/to/image.png.

This is notably useful to reproduce the behavior of markdown hosting websites, such as Github wikis, where absolute image paths are resolved against https://github.com/username/repository/wiki/.

As suggested in iamcco#651, `g:mkdp_images_path_as_root` can now be set to 1
to resolve absolute image paths against `g:mkdp_images_path`.

Example:
```
![Custom image](/path/to/image.png)
```
with `let g:mkdp_images_path = /home/user/.markdown_images`.

If `g:mkdp_images_path_as_root = 0` (default), then the image path is
interpreted as an absolute linux path, starting at the root of the
system.

If `g:mkdp_images_path_as_root = 1`, the path is interpreted as
`/home/user/.markdown_images/path/to/image.png`.

This is notably useful to reproduce the behavior of markdown hosting
websites, such as Github wikis, where absolute image paths are resolved
against https://github.com/username/repository/wiki/.
@RaidOpe RaidOpe mentioned this pull request Jun 29, 2024
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.

1 participant