From a3c027c1e6e5eb50fa31baa759e8752ed42e5f18 Mon Sep 17 00:00:00 2001 From: yosuke ota Date: Mon, 11 Apr 2022 10:00:29 +0900 Subject: [PATCH] add to_html_for_attr_value and use it --- .../render_dom/wrappers/Element/index.ts | 44 ++++++++----------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/src/compiler/compile/render_dom/wrappers/Element/index.ts b/src/compiler/compile/render_dom/wrappers/Element/index.ts index 454e50606e..00dd32f655 100644 --- a/src/compiler/compile/render_dom/wrappers/Element/index.ts +++ b/src/compiler/compile/render_dom/wrappers/Element/index.ts @@ -1001,19 +1001,7 @@ function to_html(wrappers: Array { - if (chunk.type === 'Text') { - state.quasi.value.raw += escape_html(chunk.data); - } else { - literal.quasis.push(state.quasi); - literal.expressions.push(chunk.manipulate(block)); - - state.quasi = { - type: 'TemplateElement', - value: { raw: '' } - }; - } - }); + to_html_for_attr_value(value_attribute, block, literal, state); } } @@ -1065,3 +1041,19 @@ function to_html(wrappers: Array { + if (chunk.type === 'Text') { + state.quasi.value.raw += escape_html(chunk.data); + } else { + literal.quasis.push(state.quasi); + literal.expressions.push(chunk.manipulate(block)); + + state.quasi = { + type: 'TemplateElement', + value: { raw: '' } + }; + } + }); +}