Fix: a better way to draw character list?
This commit is contained in:
parent
7b959af3e3
commit
d5ee31a080
|
@ -32,7 +32,7 @@ var usercss = (() => {
|
|||
return backgroundWorker.parseUsercssMeta(match[0], match.index)
|
||||
.catch(err => {
|
||||
if (err.code) {
|
||||
const args = ERR_ARGS_IS_LIST.has(err.code) ? err.args.join(', ') : err.args;
|
||||
const args = ERR_ARGS_IS_LIST.has(err.code) ? drawList(err.args) : err.args;
|
||||
const message = chrome.i18n.getMessage(`meta_${err.code}`, args);
|
||||
if (message) {
|
||||
err.message = message;
|
||||
|
@ -49,6 +49,10 @@ var usercss = (() => {
|
|||
});
|
||||
}
|
||||
|
||||
function drawList(chars) {
|
||||
return chars.map(c => c === '"' ? "'\"'" : `"${c}"`).join(', ');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Object} style
|
||||
* @param {Boolean} [allowErrors=false]
|
||||
|
|
Loading…
Reference in New Issue
Block a user