|
|
@ -6,7 +6,7 @@ import { AppendTarget } from '../interfaces';
|
|
|
|
import { Node } from '../../../interfaces';
|
|
|
|
import { Node } from '../../../interfaces';
|
|
|
|
import getObject from '../../../utils/getObject';
|
|
|
|
import getObject from '../../../utils/getObject';
|
|
|
|
import getTailSnippet from '../../../utils/getTailSnippet';
|
|
|
|
import getTailSnippet from '../../../utils/getTailSnippet';
|
|
|
|
import { stringify } from '../../../utils/stringify';
|
|
|
|
import { escape, escapeTemplate, stringify } from '../../../utils/stringify';
|
|
|
|
|
|
|
|
|
|
|
|
export default function visitComponent(
|
|
|
|
export default function visitComponent(
|
|
|
|
generator: SsrGenerator,
|
|
|
|
generator: SsrGenerator,
|
|
|
@ -14,7 +14,9 @@ export default function visitComponent(
|
|
|
|
node: Node
|
|
|
|
node: Node
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
function stringifyAttribute(chunk: Node) {
|
|
|
|
function stringifyAttribute(chunk: Node) {
|
|
|
|
if (chunk.type === 'Text') return chunk.data;
|
|
|
|
if (chunk.type === 'Text') {
|
|
|
|
|
|
|
|
return escapeTemplate(escape(chunk.data));
|
|
|
|
|
|
|
|
}
|
|
|
|
if (chunk.type === 'MustacheTag') {
|
|
|
|
if (chunk.type === 'MustacheTag') {
|
|
|
|
block.contextualise(chunk.expression);
|
|
|
|
block.contextualise(chunk.expression);
|
|
|
|
const { snippet } = chunk.metadata;
|
|
|
|
const { snippet } = chunk.metadata;
|
|
|
|