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'
|
||||
|
||||
usercss: `<%= multiline(read('user.css')) %>`
|
||||
usercss: `<%= JSON.stringify(read('user.css')) %>`
|
||||
|
||||
hotkeys:
|
||||
# QR & Options
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
"expr": true,
|
||||
"sub": true,
|
||||
"scripturl": true,
|
||||
"multistr": true,
|
||||
"browser": true,
|
||||
"devel": true,
|
||||
"nonstandard": true,
|
||||
|
||||
@ -21,7 +21,7 @@ tools.readHTML = function(filename) {
|
||||
};
|
||||
|
||||
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).
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user