format/html.js
function setFormatting(outNode, profile) {
	const node = outNode.node;

	if (shouldFormatNode(node, profile)) {
		outNode.indent = profile.indent(getIndentLevel(node, profile));
		outNode.newline = '\n';
		const prefix = outNode.newline + outNode.indent;

		// do not format the very first node in output
		if (!isRoot(node.parent) || !isFirstChild(node)) {
			outNode.beforeOpen = prefix;
			if (node.isTextOnly) {
				outNode.beforeText = prefix;
			}
		}

		if (hasInnerFormatting(node, profile)) {
			if (!node.isTextOnly) {
				outNode.beforeText = prefix + profile.indent(1);
			}
			outNode.beforeClose = prefix;
		}
	}

	return outNode;
}
function setFormatting(outNode, profile) {
	const node = outNode.node;

	if (shouldFormatNode(node, profile)) {
		outNode.indent = profile.indent(getIndentLevel(node, profile));
		outNode.newline = '\n';
		const prefix = outNode.newline + outNode.indent;

		// do not format the very first node in output
		if (!isRoot(node.parent) || !isFirstChild(node)) {
			outNode.beforeOpen = prefix;
			if (node.isTextOnly) {
				outNode.beforeText = prefix;
			}
		}

		if (hasInnerFormatting(node, profile)) {
			if (!node.isTextOnly) {
				outNode.beforeText = prefix + profile.indent(1);
			}
			outNode.beforeClose = prefix;
		}
	}

	return outNode;
}
function setFormatting ( outNode , profile ) { const node = outNode . node ; if ( shouldFormatNode ( node , profile ) ) { outNode . indent = profile . indent ( getIndentLevel ( node , profile ) ) ; outNode . newline = '\n' ; const prefix = outNode . newline + outNode . indent ; // do not format the very first node in output if ( ! isRoot ( node . parent ) || ! isFirstChild ( node ) ) { outNode . beforeOpen = prefix ; if ( node . isTextOnly ) { outNode . beforeText = prefix ; } } if ( hasInnerFormatting ( node , profile ) ) { if ( ! node . isTextOnly ) { outNode . beforeText = prefix + profile . indent ( 1 ) ; } outNode . beforeClose = prefix ; } } return outNode ; }
Updates formatting properties for given output node
@param  {OutputNode} outNode Output wrapper of farsed abbreviation node
@param  {Profile}    profile Output profile
@return {OutputNode}
Updates formatting properties for given output node