Use backslashes instead of concatenation for multiline strings. #960
This commit is contained in:
parent
b569a8dbbd
commit
9426dab656
@ -821,7 +821,7 @@ Config =
|
|||||||
|
|
||||||
favicon: 'ferongr'
|
favicon: 'ferongr'
|
||||||
|
|
||||||
usercss: `<%= multiline(read('user.css')) %>`
|
usercss: `<%= JSON.stringify(read('user.css')) %>`
|
||||||
|
|
||||||
hotkeys:
|
hotkeys:
|
||||||
# QR & Options
|
# QR & Options
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
"expr": true,
|
"expr": true,
|
||||||
"sub": true,
|
"sub": true,
|
||||||
"scripturl": true,
|
"scripturl": true,
|
||||||
|
"multistr": true,
|
||||||
"browser": true,
|
"browser": true,
|
||||||
"devel": true,
|
"devel": true,
|
||||||
"nonstandard": true,
|
"nonstandard": true,
|
||||||
|
|||||||
@ -21,7 +21,7 @@ tools.readHTML = function(filename) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
tools.multiline = function(text) {
|
tools.multiline = function(text) {
|
||||||
return text.replace(/\n+/g, '\n').split(/^/m).map(JSON.stringify).join(' +\n').replace(/`/g, '\\`');
|
return text.replace(/\n+/g, '\n').split(/^/m).map(JSON.stringify).join('+').replace(/"\+"/g, '\\\n');
|
||||||
};
|
};
|
||||||
|
|
||||||
// Convert JSON object to Coffeescript expression (via embedded JS).
|
// Convert JSON object to Coffeescript expression (via embedded JS).
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user