Fix SVG generator on cutting values
This commit is contained in:
parent
8ce6786020
commit
be9fb9a3bd
|
|
@ -9,7 +9,7 @@ export default function svg(rules) {
|
|||
parse_grid('1x1')
|
||||
);
|
||||
let raw = result && result.styles && result.styles.cells || '';
|
||||
let cut = raw.substring(52, raw.length - 5);
|
||||
let cut = raw.substring(raw.indexOf('%3'), raw.lastIndexOf('");'));
|
||||
try {
|
||||
return decodeURIComponent(cut);
|
||||
} catch (e) {
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ class Rules {
|
|||
}
|
||||
}
|
||||
|
||||
if (prop === 'background' && (value.includes('shader') || value.includes('canvas') || value.includes('pattern'))) {
|
||||
if (prop === 'background' && (value.includes('@shader') || value.includes('@canvas') || value.includes('@pattern'))) {
|
||||
rule += 'background-size: 100% 100%;';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ function readStatement(iter, token) {
|
|||
} else {
|
||||
stackQuote.pop();
|
||||
}
|
||||
if (next.isSymbol('}') && !stackQuote.length) {
|
||||
if ((next && next.isSymbol('}')) && !stackQuote.length) {
|
||||
isStatementBreak = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue