Skip to content

Commit 9158d03

Browse files
committed
fix pseudo-images parsing
1 parent 059a310 commit 9158d03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/ui/parse_image.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function parseEmptyImage(style, fullReplaceString, box, params) {
5757
function parseImg(fullString, img, style) {
5858
var image = img;
5959
var parsedImg = '';
60-
var imgStyle = style ? style : 'max-width: 100%;';
60+
var imgStyle = style && !Number.isInteger(style) ? style : 'max-width: 100%;';
6161

6262
if (Sprite.is(img)) {
6363
return Sprite.asImage(img);
@@ -83,8 +83,8 @@ function parseImg(fullString, img, style) {
8383
}
8484

8585
// Parse pseudo-images (box, blank)
86-
if (img.indexOf('box') === 0 || img.indexOf('blank') === 0) {
87-
return img.replace(/(box|blank):(.+)/, function imgReplacer() {
86+
if (image.indexOf('box') === 0 || image.indexOf('blank') === 0) {
87+
return image.replace(/(box|blank):(.+)/, function imgReplacer() {
8888
var args = Array.prototype.slice.call(arguments);
8989
args.unshift(imgStyle);
9090
return parseEmptyImage.apply(null, args);

0 commit comments

Comments
 (0)