first commit
This commit is contained in:
commit
eb2f504652
32490 changed files with 5731109 additions and 0 deletions
42
node_modules/html2canvas/dist/lib/css/property-descriptors/quotes.js
generated
vendored
Normal file
42
node_modules/html2canvas/dist/lib/css/property-descriptors/quotes.js
generated
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getQuote = exports.quotes = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
exports.quotes = {
|
||||
name: 'quotes',
|
||||
initialValue: 'none',
|
||||
prefix: true,
|
||||
type: 1 /* LIST */,
|
||||
parse: function (_context, tokens) {
|
||||
if (tokens.length === 0) {
|
||||
return null;
|
||||
}
|
||||
var first = tokens[0];
|
||||
if (first.type === 20 /* IDENT_TOKEN */ && first.value === 'none') {
|
||||
return null;
|
||||
}
|
||||
var quotes = [];
|
||||
var filtered = tokens.filter(parser_1.isStringToken);
|
||||
if (filtered.length % 2 !== 0) {
|
||||
return null;
|
||||
}
|
||||
for (var i = 0; i < filtered.length; i += 2) {
|
||||
var open_1 = filtered[i].value;
|
||||
var close_1 = filtered[i + 1].value;
|
||||
quotes.push({ open: open_1, close: close_1 });
|
||||
}
|
||||
return quotes;
|
||||
}
|
||||
};
|
||||
var getQuote = function (quotes, depth, open) {
|
||||
if (!quotes) {
|
||||
return '';
|
||||
}
|
||||
var quote = quotes[Math.min(depth, quotes.length - 1)];
|
||||
if (!quote) {
|
||||
return '';
|
||||
}
|
||||
return open ? quote.open : quote.close;
|
||||
};
|
||||
exports.getQuote = getQuote;
|
||||
//# sourceMappingURL=quotes.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue