Skip to content
Snippets Groups Projects
Verified Commit 19cc27a5 authored by Isabella Skořepová's avatar Isabella Skořepová
Browse files

Fix images with absolute path not displaying

Fixes #47
parent 88b918dd
No related branches found
No related tags found
No related merge requests found
......@@ -73,8 +73,9 @@ module.exports = function(href, title, text, curFile, cfg) {
if(youtube.isVideo(href)) {
return renderYoutube(href, options);
} else {
var genHTML = function(file) {
var rel = path.relative(process.cwd(),file);
var genHTML = function(file, norel) {
var rel = file;
if(!norel) path.relative(process.cwd(),file);
var out = '<img src="' + rel + '" alt="' + text + '"';
if(options.width) {
......@@ -100,9 +101,9 @@ module.exports = function(href, title, text, curFile, cfg) {
var parsedHref = url.parse(href);
if(parsedHref.host) {
genHTML(href);
return genHTML(href, true);
} else if(path.isAbsolute(href)) {
genHTML(href);
return genHTML(href);
} else {
curFile = curFile.replace(/\.md$/,'');
var targetDir = rewriteURL(curFile);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment