From 329c6dd27b510ed538fcaf673541aef2c30b2980 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 12 Sep 2020 20:33:46 -0700 Subject: [PATCH] Trim whitespace from html_to_element input. --- frontends/etiquette_flask/static/js/common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontends/etiquette_flask/static/js/common.js b/frontends/etiquette_flask/static/js/common.js index a8afd9a..635dbd3 100644 --- a/frontends/etiquette_flask/static/js/common.js +++ b/frontends/etiquette_flask/static/js/common.js @@ -169,8 +169,8 @@ common.html_to_element = function html_to_element(html) { let template = document.createElement("template"); - template.innerHTML = html; - return template.content.firstChild; + template.innerHTML = html.trim(); + return template.content.firstElementChild; } common.init_atag_merge_params =