format/html.js
function getIndentLevel(node, profile) {
	// Increase indent level IF NOT:
	// * parent is text-only node
	// * there’s a parent node with a name that is explicitly set to decrease level
	const skip = profile.get('formatSkip') || [];
	let level = node.parent.isTextOnly ? -2 : -1;
	let ctx = node;
	while (ctx = ctx.parent) {
		if (skip.indexOf( (ctx.name || '').toLowerCase() ) === -1) {
			level++;
		}
	}

	return level < 0 ? 0 : level;
}
function getIndentLevel(node, profile) {
	// Increase indent level IF NOT:
	// * parent is text-only node
	// * there’s a parent node with a name that is explicitly set to decrease level
	const skip = profile.get('formatSkip') || [];
	let level = node.parent.isTextOnly ? -2 : -1;
	let ctx = node;
	while (ctx = ctx.parent) {
		if (skip.indexOf( (ctx.name || '').toLowerCase() ) === -1) {
			level++;
		}
	}

	return level < 0 ? 0 : level;
}
function getIndentLevel ( node , profile ) { // Increase indent level IF NOT: // * parent is text-only node // * there’s a parent node with a name that is explicitly set to decrease level const skip = profile . get ( 'formatSkip' ) || [ ] ; let level = node . parent . isTextOnly ? - 2 : - 1 ; let ctx = node ; while ( ctx = ctx . parent ) { if ( skip . indexOf ( ( ctx . name || '' ) . toLowerCase ( ) ) === - 1 ) { level ++ ; } } return level < 0 ? 0 : level ; }
Computes indent level for given node
@param  {Node} node
@param  {Profile} profile
@param  {Number} level
@return {Number}
Computes indent level for given node