Skip to content

Commit 406670c

Browse files
committed
fix: fixed rendering of color in coverpage issue
1 parent 1811842 commit 406670c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/core/render/compiler/image.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getAndRemoveConfig } from '../compiler';
1+
import { getAndRemoveConfig } from '../utils';
22
import { isAbsolutePath, getPath, getParentPath } from '../../router/util';
33

44
export const imageCompiler = ({ renderer, contentBase, router }) =>
@@ -38,7 +38,11 @@ export const imageCompiler = ({ renderer, contentBase, router }) =>
3838
url = getPath(contentBase, getParentPath(router.getCurrentPath()), href);
3939
}
4040

41-
return `<img src="${url}" data-origin="${href}" alt="${text}" ${attrs.join(
42-
' '
43-
)} />`;
41+
if (attrs.length > 0) {
42+
return `<img src="${url}" data-origin="${href}" alt="${text}" ${attrs.join(
43+
' '
44+
)} />`;
45+
}
46+
47+
return `<img src="${url}" data-origin="${href}" alt="${text}"${attrs}>`;
4448
});

0 commit comments

Comments
 (0)