mirror of https://github.com/sveltejs/svelte
parent
e7d324f305
commit
b8705a5b0c
@ -1,3 +1,3 @@
|
|||||||
export default {
|
export default function visitComment () {
|
||||||
// do nothing
|
// do nothing
|
||||||
};
|
}
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
export default {
|
export default function visitText ( generator, node ) {
|
||||||
enter ( generator, node ) {
|
|
||||||
if ( generator.current.namespace && !/\S/.test( node.data ) ) {
|
if ( generator.current.namespace && !/\S/.test( node.data ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const name = generator.current.getUniqueName( `text` );
|
const name = generator.current.getUniqueName( `text` );
|
||||||
generator.addElement( name, `${generator.helper( 'createText' )}( ${JSON.stringify( node.data )} )`, false );
|
generator.addElement( name, `${generator.helper( 'createText' )}( ${JSON.stringify( node.data )} )`, false );
|
||||||
}
|
}
|
||||||
};
|
|
Loading…
Reference in new issue