|
|
@ -1,5 +1,3 @@
|
|
|
|
import deindent from '../../../utils/deindent.js';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
enter ( generator, node ) {
|
|
|
|
enter ( generator, node ) {
|
|
|
|
const name = generator.current.getUniqueName( 'raw' );
|
|
|
|
const name = generator.current.getUniqueName( 'raw' );
|
|
|
@ -20,11 +18,8 @@ export default {
|
|
|
|
const isToplevel = generator.current.localElementDepth === 0;
|
|
|
|
const isToplevel = generator.current.localElementDepth === 0;
|
|
|
|
|
|
|
|
|
|
|
|
const mountStatement = `${before}.insertAdjacentHTML( 'afterend', ${snippet} );`;
|
|
|
|
const mountStatement = `${before}.insertAdjacentHTML( 'afterend', ${snippet} );`;
|
|
|
|
const detachStatement = deindent`
|
|
|
|
generator.uses.detachBetween = true;
|
|
|
|
while ( ${before}.nextSibling && ${before}.nextSibling !== ${after} ) {
|
|
|
|
const detachStatement = `detachBetween( ${before}, ${after} );`;
|
|
|
|
${before}.parentNode.removeChild( ${before}.nextSibling );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( isToplevel ) {
|
|
|
|
if ( isToplevel ) {
|
|
|
|
generator.current.builders.mount.addLine( mountStatement );
|
|
|
|
generator.current.builders.mount.addLine( mountStatement );
|
|
|
|