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

	return node.attributes.map(attr => {
		if (attr.options.implied && attr.value == null) {
			return null;
		}

		const attrName = profile.attribute(attr.name);
		let attrValue = null;

		// handle boolean attributes
		if (attr.options.boolean || profile.get('booleanAttributes').indexOf(attrName.toLowerCase()) !== -1) {
			if (profile.get('compactBooleanAttributes') && attr.value == null) {
				return ` ${attrName}`;
			} else if (attr.value == null) {
				attrValue = attrName;
			}
		}

		if (attrValue == null) {
			attrValue = outNode.renderFields(attr.value);
		}

		return attr.options.before && attr.options.after
			? ` ${attrName}=${attr.options.before+attrValue+attr.options.after}`
			: ` ${attrName}=${profile.quote(attrValue)}`;
	}).join('');
}
function formatAttributes(outNode, profile) {
	const node = outNode.node;

	return node.attributes.map(attr => {
		if (attr.options.implied && attr.value == null) {
			return null;
		}

		const attrName = profile.attribute(attr.name);
		let attrValue = null;

		// handle boolean attributes
		if (attr.options.boolean || profile.get('booleanAttributes').indexOf(attrName.toLowerCase()) !== -1) {
			if (profile.get('compactBooleanAttributes') && attr.value == null) {
				return ` ${attrName}`;
			} else if (attr.value == null) {
				attrValue = attrName;
			}
		}

		if (attrValue == null) {
			attrValue = outNode.renderFields(attr.value);
		}

		return attr.options.before && attr.options.after
			? ` ${attrName}=${attr.options.before+attrValue+attr.options.after}`
			: ` ${attrName}=${profile.quote(attrValue)}`;
	}).join('');
}
function formatAttributes ( outNode , profile ) { const node = outNode . node ; return node . attributes . map ( attr => { if ( attr . options . implied && attr . value == null ) { return null ; } const attrName = profile . attribute ( attr . name ) ; let attrValue = null ; // handle boolean attributes if ( attr . options . boolean || profile . get ( 'booleanAttributes' ) . indexOf ( attrName . toLowerCase ( ) ) !== - 1 ) { if ( profile . get ( 'compactBooleanAttributes' ) && attr . value == null ) { return ` ${ attrName } ` ; } else if ( attr . value == null ) { attrValue = attrName ; } } if ( attrValue == null ) { attrValue = outNode . renderFields ( attr . value ) ; } return attr . options . before && attr . options . after ? ` ${ attrName } ${ attr . options . before + attrValue + attr . options . after } ` : ` ${ attrName } ${ profile . quote ( attrValue ) } ` ; } ) . join ( '' ) ; }
Outputs attributes of given abbreviation node as HTML attributes
@param  {OutputNode} outNode
@param  {Profile}    profile
@return {String}
Outputs attributes of given abbreviation node as HTML attributes