src/parser/jadeLike.js
function appendDirEnd(str, struct) {
	if (!struct.block) {
		return str;
	}

	const [rightSpace] = rightWSRgxp.exec(str);
	str = str.replace(rightPartRgxp, '');

	const
		s = alb + lb,
		e = rb;

	let tmp;
	if (needSpace) {
		tmp = `${struct.trim.right ? '' : eol}${endDirInit ? '' : `${s}__&+__${e}`}${struct.trim.right ? eol : ''}`;

	} else {
		tmp = eol + struct.space.slice(1);
	}

	endDirInit = true;
	str += `${tmp}${struct.adv + lb}__end__${e}${s}__cutLine__${e}`;

	if (rightSpace && needSpace) {
		str += `${s}__&-__${rb}`;
	}

	return str + rightSpace;
}
function appendDirEnd(str, struct) {
	if (!struct.block) {
		return str;
	}

	const [rightSpace] = rightWSRgxp.exec(str);
	str = str.replace(rightPartRgxp, '');

	const
		s = alb + lb,
		e = rb;

	let tmp;
	if (needSpace) {
		tmp = `${struct.trim.right ? '' : eol}${endDirInit ? '' : `${s}__&+__${e}`}${struct.trim.right ? eol : ''}`;

	} else {
		tmp = eol + struct.space.slice(1);
	}

	endDirInit = true;
	str += `${tmp}${struct.adv + lb}__end__${e}${s}__cutLine__${e}`;

	if (rightSpace && needSpace) {
		str += `${s}__&-__${rb}`;
	}

	return str + rightSpace;
}
function appendDirEnd ( str , struct ) { if ( ! struct . block ) { return str ; } const [ rightSpace ] = rightWSRgxp . exec ( str ) ; str = str . replace ( rightPartRgxp , '' ) ; const s = alb + lb , e = rb ; let tmp ; if ( needSpace ) { tmp = ` ${ struct . trim . right ? '' : eol } ${ endDirInit ? '' : ` ${ s } ${ e } ` } ${ struct . trim . right ? eol : '' } ` ; } else { tmp = eol + struct . space . slice ( 1 ) ; } endDirInit = true ; str += ` ${ tmp } ${ struct . adv + lb } ${ e } ${ s } ${ e } ` ; if ( rightSpace && needSpace ) { str += ` ${ s } ${ rb } ` ; } return str + rightSpace ; }
Appends the directive end for a resulting string
and returns a new string

@param {string} str - resulting string
@param {!Object} struct - structure object
@return {string}
Appends the directive end for a resulting string and returns a new string