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

baseUrl doesn't work on <img> tag #1502

Closed
AkatQuas opened this issue Jun 14, 2019 · 2 comments
Closed

baseUrl doesn't work on <img> tag #1502

AkatQuas opened this issue Jun 14, 2019 · 2 comments

Comments

@AkatQuas
Copy link

Describe the bug
The baseUrl isn't added to the tag.

To Reproduce
Steps to reproduce the behavior:

// marked configuration
marked.setOptions({
  renderer: new marked.Renderer(),
  highlight: function (code) {
    return require('highlight.js').highlightAuto(code).value;
  },
  baseUrl: 'http://example.com/',
  pedantic: false,
  gfm: true,
  tables: true,
  breaks: false,
  sanitize: false,
  smartLists: true,
  smartypants: false,
  xhtml: false
});

markdown content

<img src="static/cat.svg" width="200">

![](static/cat.svg)

Real Output

<img src="static/cat.svg" width="200">
<p><img src="http://example.com/static/cat.svg" alt=""></p>

Expected behavior
The baseUrl should be added to the tag.

<img src="http://example.com/static/cat.svg" width="200">
<p><img src="http://example.com/static/cat.svg" alt=""></p>
@UziTech
Copy link
Member

UziTech commented Jun 14, 2019

baseUrl is only used in markdown links and images not raw html since raw HTML is used to get specific html into the output.

@AkatQuas
Copy link
Author

Thanks a lot, I try to avoid using raw HTML in my markdown 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants