question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to add images from root?

See original GitHub issue

For example, I have 2 folders in the root directory. There is a picture in the first folder (images).

The second folder (docs) contains the markdown file.

How do I insert an image into this markdown file that is located in the folder (images).

If I put it this way:

![](/images/testimage.jpg)

He tries to add it like this:

/docs/images/testimage.jpg

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:22 (4 by maintainers)

github_iconTop GitHub Comments

10reactions
cptcanuckcommented, Feb 13, 2020

This is still an issue.

6reactions
bajinscommented, Mar 6, 2020
hook.beforeEach(function(content) {
    return content.replace(new RegExp("/images", 'ig'), "../images");
})

or

hook.afterEach(function(html, next) {
    let reg = new RegExp(vm.config.basePath + ".*/images", 'ig');
    html = html.replace(reg, vm.config.basePath + "images");
    next(html);
})

or

markdown: {
    // https://marked.js.org/#/USING_PRO.md#renderer
    renderer: {
        image: function(href, title) {
            return `<img src="${href}" data-origin="${href}" alt="${title}">`
        }
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Image tutorials - ROOT
Importing an image and manipulating it. file, hist2image.C · View in nbviewer Open in SWAN Create an image from a 2-D histogram and...
Read more >
Pick images of root folder from sub-folder - html - Stack Overflow
3. Just to add some point. If you are using localhost on IIS, /images/logo. · where would be the root folder in this...
Read more >
Add Image to root folder - MSDN - Microsoft
According to your description and needs, I make a sample that check if exist this file in the root path when you upload...
Read more >
How to Insert an Image in HTML - YouTube
How to Insert an Image in HTML | Insert Image From Folder | Wrap Text- Align / Float Images With CSS. 348 views...
Read more >
<img>: The Image Embed element - HTML - MDN Web Docs
The HTML element embeds an image into the document. ... Navigations on the same origin will still include the path. same-origin : A...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found