Commit 19cc27a5 authored by Isabella Skořepová's avatar Isabella Skořepová

Fix images with absolute path not displaying

Fixes #47
parent 88b918dd
Pipeline #230 passed with stages
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment