Skip to content

Commit

Permalink
解决 inline-style css能力丢失的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
2betop committed Jun 1, 2016
1 parent 7d27e3a commit d398593
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ function extHtml(content, callback, file) {
m = '<!--' + analyseComment($8) + $9;
} else if ($10) {
var quote = $10[0];
m = 'style=' + quote + map.inlineStyle.wrap($10.substring(1, $10.length - 1), 'inline-style') + quote;
m = 'style=' + quote + map.inlineStyle.wrap($10.substring(1, $10.length - 1)) + quote;
}
return m;
};
Expand Down Expand Up @@ -1026,7 +1026,10 @@ function postStandard(file, context) {
break;

case 'inlineStyle':
ret = partial('inline-style-placeholder {' + value + '}', file, extra);
ret = partial('inline-style-placeholder {' + value + '}', file, {
ext: 'css',
xLang: ':inline-style'
});
ret = ret.replace(/inline-style-placeholder\s?\{([\s\S]*)\}/, '$1');
break;

Expand Down Expand Up @@ -1126,7 +1129,7 @@ function partial(content, host, info) {
var ext = info.ext || host.ext;
ext[0] === '.' && (ext = ext.substring(1));
info.ext = '.' + ext;
info.xLang = ':' + ext;
info.xLang = info.xLang || (':' + ext);

var f = fis.file(host.realpath, info);
f.cache = host.cache;
Expand Down

0 comments on commit d398593

Please sign in to comment.