fix: fixed rendering of color in coverpage issue

This commit is contained in:
Anix
2020-03-09 20:30:01 +05:30
parent 1811842979
commit 406670c3d6
+8 -4
View File
@@ -1,4 +1,4 @@
import { getAndRemoveConfig } from '../compiler';
import { getAndRemoveConfig } from '../utils';
import { isAbsolutePath, getPath, getParentPath } from '../../router/util';
export const imageCompiler = ({ renderer, contentBase, router }) =>
@@ -38,7 +38,11 @@ export const imageCompiler = ({ renderer, contentBase, router }) =>
url = getPath(contentBase, getParentPath(router.getCurrentPath()), href);
}
return `<img src="${url}" data-origin="${href}" alt="${text}" ${attrs.join(
' '
)} />`;
if (attrs.length > 0) {
return `<img src="${url}" data-origin="${href}" alt="${text}" ${attrs.join(
' '
)} />`;
}
return `<img src="${url}" data-origin="${href}" alt="${text}"${attrs}>`;
});