mirror of https://github.com/sveltejs/svelte
parent
a236794763
commit
f21c3b7136
@ -1,4 +1,4 @@
|
|||||||
import { snip } from '../../../utils/snip';
|
import { snip } from '../../utils/snip';
|
||||||
|
|
||||||
export default function(node, renderer, options) {
|
export default function(node, renderer, options) {
|
||||||
renderer.append('${' + snip(node.expression) + '}');
|
renderer.append('${' + snip(node.expression) + '}');
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import Attribute from '../compile/nodes/Attribute';
|
import Attribute from '../nodes/Attribute';
|
||||||
import Node from '../compile/nodes/shared/Node';
|
import Node from '../nodes/shared/Node';
|
||||||
import { escapeTemplate, escape } from './stringify';
|
import { escape_template, escape } from './stringify';
|
||||||
import { snip } from './snip';
|
import { snip } from './snip';
|
||||||
|
|
||||||
export function stringify_attribute(attribute: Attribute, is_ssr: boolean) {
|
export function stringify_attribute(attribute: Attribute, is_ssr: boolean) {
|
||||||
return attribute.chunks
|
return attribute.chunks
|
||||||
.map((chunk: Node) => {
|
.map((chunk: Node) => {
|
||||||
if (chunk.type === 'Text') {
|
if (chunk.type === 'Text') {
|
||||||
return escapeTemplate(escape(chunk.data).replace(/"/g, '"'));
|
return escape_template(escape(chunk.data).replace(/"/g, '"'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return is_ssr
|
return is_ssr
|
Loading…
Reference in new issue