Skip to content

Commit 4c66214

Browse files
committed
Use javascript string escaping in Polymer.html
There's a lot of pitfalls Fixes #5060
1 parent 90199f3 commit 4c66214

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/utils/html-tag.html

+1-4
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,9 @@
5252
* @return {!HTMLTemplateElement} Constructed HTMLTemplateElement
5353
*/
5454
Polymer.html = function html(strings, ...values) {
55-
// use raw strings to preserve literal escapes in strings
56-
/** @type {!Array<string>} */
57-
const rawStrings = strings.raw;
5855
const template = /** @type {!HTMLTemplateElement} */(document.createElement('template'));
5956
template.innerHTML = values.reduce((acc, v, idx) =>
60-
acc + htmlValue(v) + rawStrings[idx + 1], rawStrings[0]);
57+
acc + htmlValue(v) + strings[idx + 1], strings[0]);
6158
return template;
6259
};
6360
})();

0 commit comments

Comments
 (0)