mirror of https://github.com/sveltejs/svelte
parent
95e9c69dac
commit
c582efe9ec
@ -1,12 +1,7 @@
|
||||
const BOM_CHARACTER = String.fromCharCode(65279);
|
||||
|
||||
/**
|
||||
* @param {string} str
|
||||
* @returns {string}
|
||||
*/
|
||||
export function sanitize_template_string(str) {
|
||||
return str
|
||||
.replace(/(`|\${|\\)/g, '\\$1')
|
||||
.replaceAll(BOM_CHARACTER, '')
|
||||
.replaceAll('', '');
|
||||
return str.replace(/(`|\${|\\)/g, '\\$1');
|
||||
}
|
||||
|
||||
Loading…
Reference in new issue