|
|
|
@ -1001,19 +1001,7 @@ function to_html(wrappers: Array<ElementWrapper | TextWrapper | MustacheTagWrapp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
state.quasi.value.raw += ` ${fix_attribute_casing(attr.node.name)}="`;
|
|
|
|
state.quasi.value.raw += ` ${fix_attribute_casing(attr.node.name)}="`;
|
|
|
|
|
|
|
|
|
|
|
|
attr.node.chunks.forEach(chunk => {
|
|
|
|
to_html_for_attr_value(attr, block, literal, state);
|
|
|
|
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: '' }
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
state.quasi.value.raw += '"';
|
|
|
|
state.quasi.value.raw += '"';
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -1040,7 +1028,22 @@ function to_html(wrappers: Array<ElementWrapper | TextWrapper | MustacheTagWrapp
|
|
|
|
if (first && first.type === 'Text' && start_newline.test(first.data)) {
|
|
|
|
if (first && first.type === 'Text' && start_newline.test(first.data)) {
|
|
|
|
state.quasi.value.raw += '\n';
|
|
|
|
state.quasi.value.raw += '\n';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
value_attribute.node.chunks.forEach(chunk => {
|
|
|
|
to_html_for_attr_value(value_attribute, block, literal, state);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
to_html(wrapper.fragment.nodes as Array<ElementWrapper | TextWrapper>, block, literal, state);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
state.quasi.value.raw += `</${wrapper.node.name}>`;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
state.quasi.value.raw += '/>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function to_html_for_attr_value(attr: AttributeWrapper | StyleAttributeWrapper | SpreadAttributeWrapper, block: Block, literal: any, state: any) {
|
|
|
|
|
|
|
|
attr.node.chunks.forEach(chunk => {
|
|
|
|
if (chunk.type === 'Text') {
|
|
|
|
if (chunk.type === 'Text') {
|
|
|
|
state.quasi.value.raw += escape_html(chunk.data);
|
|
|
|
state.quasi.value.raw += escape_html(chunk.data);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -1054,14 +1057,3 @@ function to_html(wrappers: Array<ElementWrapper | TextWrapper | MustacheTagWrapp
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
to_html(wrapper.fragment.nodes as Array<ElementWrapper | TextWrapper>, block, literal, state);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
state.quasi.value.raw += `</${wrapper.node.name}>`;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
state.quasi.value.raw += '/>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|