-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Describe the bug
For usage in github pages I'd like to use the baseUrl option to add a prefix of the project name for relative links. For instance with a github pages site like matt.github.io/derp with derp being the project name. I'd like relative links to change from /link to /derp/link.
Marked options
const options = {
baseUrl: '/derp/',
}Markdown
'Output html
<p><img src="/derp/favicon.ico" alt="alt text" title="relative"></p>What is actually happening is:
<p><img src="/derp//favicon.ico" alt="alt text" title="relative"></p>Maybe it is as simple as not inverting rtrim here:
https://github.com/markedjs/marked/blob/master/lib/marked.js#L1417
To Reproduce
This code sandbox should show the issue. Check the console
https://codesandbox.io/s/9ql03o5114
I was able to reproduce this in both 0.5.0 and 0.6.2.
Expected behavior
I expect html output to look like this:
<p><img src="/derp/favicon.ico" alt="alt text" title="relative"></p>Metadata
Metadata
Assignees
Labels
No labels