lib/packages/parsers.js
function(result, tag) {

		var is_void = Lava.isVoidTag(tag.name),
			tag_start_text = "<" + tag.name
				+ this.renderTagAttributes(tag.attributes)
				+ (is_void ? '/>' : '>'),
			inner_template,
			count;

		this. _compileString(result, tag_start_text);

		if (Lava.schema.DEBUG && is_void && tag.content) Lava.t("Void tag with content");

		if (!is_void) {

			if (tag.content) {

				inner_template = this.compileTemplate(tag.content);
				count = inner_template.length;

				if (count && typeof (inner_template[0]) == 'string') {

					this._compileString(result, inner_template.shift());
					count--;

				}

				if (count) {

					result.splice.apply(result, [result.length, 0].concat(inner_template));

				}

			}

			this. _compileString(result, "</" + tag.name + ">");

		}

	}
function(result, tag) {

		var is_void = Lava.isVoidTag(tag.name),
			tag_start_text = "<" + tag.name
				+ this.renderTagAttributes(tag.attributes)
				+ (is_void ? '/>' : '>'),
			inner_template,
			count;

		this. _compileString(result, tag_start_text);

		if (Lava.schema.DEBUG && is_void && tag.content) Lava.t("Void tag with content");

		if (!is_void) {

			if (tag.content) {

				inner_template = this.compileTemplate(tag.content);
				count = inner_template.length;

				if (count && typeof (inner_template[0]) == 'string') {

					this._compileString(result, inner_template.shift());
					count--;

				}

				if (count) {

					result.splice.apply(result, [result.length, 0].concat(inner_template));

				}

			}

			this. _compileString(result, "</" + tag.name + ">");

		}

	}
function ( result , tag ) { var is_void = Lava . isVoidTag ( tag . name ) , tag_start_text = "<" + tag . name + this . renderTagAttributes ( tag . attributes ) + ( is_void ? '/>' : '>' ) , inner_template , count ; this . _compileString ( result , tag_start_text ) ; if ( Lava . schema . DEBUG && is_void && tag . content ) Lava . t ( "Void tag with content" ) ; if ( ! is_void ) { if ( tag . content ) { inner_template = this . compileTemplate ( tag . content ) ; count = inner_template . length ; if ( count && typeof ( inner_template [ 0 ] ) == 'string' ) { this . _compileString ( result , inner_template . shift ( ) ) ; count -- ; } if ( count ) { result . splice . apply ( result , [ result . length , 0 ] . concat ( inner_template ) ) ; } } this . _compileString ( result , "</" + tag . name + ">" ) ; } }
Serialize the tag back into text
@param {_tTemplate} result
@param {_cRawTag} tag
Serialize the tag back into text