Displaying a remote markdown with images
See original GitHub issueWhile it works fine providing a markdown file hosted e.g. on github with the src attribute, relative paths do not work, since ngx-markdown uses the base url for resolving relative paths.
Little demo , click on the Code of Conduct Link and it won’t work because it should link to
https://github.com/Microsoft/vscode/CODE_OF_CONDUCT.md
but is actually linked to
https://run.plnkr.co/iPObnRnGowv03lXn/CODE_OF_CONDUCT.md
I think ngx-markdown should be abled to deal properly with relative links as they are handy and commonly used to link other resources and images without breaking across plattforms.
If this behavior should not be part of ngx-markdown, how could I make a workaround for it?
As this package is used marked.js , we can probably utilize the baseUrl Parameter here https://marked.js.org/#/USING_ADVANCED.md#options and set it to the src Path without the filename at the end.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:6 (1 by maintainers)
@jfcere This is my resolve thanks to @raspyweather
Awesome job! Works great for me!