dist/yaml.legacy.js
function(separator, indicator, indentation)
	{
		if ( indicator == undefined ) indicator = '';
		if ( indentation == undefined ) indentation = 0;
		
		separator = '|' == separator ? "\n" : ' ';
		var text = '';
		var diff = null;

		var notEOF = this.moveToNextLine();

		while ( notEOF && this.isCurrentLineBlank() )
		{
			text += "\n";

			notEOF = this.moveToNextLine();
		}

		if ( !notEOF )
		{
			return '';
		}

		var matches = null;
		if ( !(matches = new RegExp('^('+(indentation ? this.strRepeat(' ', indentation) : ' +')+')(.*)$').exec(this.currentLine)) )
		{
			this.moveToPreviousLine();

			return '';
		}
		
		matches = {indent: matches[1], text: matches[2]};
		
		var textIndent = matches.indent;
		var previousIndent = 0;

		text += matches.text + separator;
		while ( this.currentLineNb + 1 < this.lines.length )
		{
			this.moveToNextLine();
			
			if ( matches = new RegExp('^( {'+textIndent.length+',})(.+)$').exec(this.currentLine) )
			{
				matches = {indent: matches[1], text: matches[2]};
				
				if ( ' ' == separator && previousIndent != matches.indent )
				{
					text = text.substr(0, text.length - 1)+"\n";
				}
				
				previousIndent = matches.indent;

				diff = matches.indent.length - textIndent.length;
				text += this.strRepeat(' ', diff) + matches.text + (diff != 0 ? "\n" : separator);
			}
			else if ( matches = /^( *)$/.exec(this.currentLine) )
			{
				text += matches[1].replace(new RegExp('^ {1,'+textIndent.length+'}','g'), '')+"\n";
			}
			else
			{
				this.moveToPreviousLine();

				break;
			}
		}

		if ( ' ' == separator )
		{
			// replace last separator by a newline
			text = text.replace(/ (\n*)$/g, "\n$1");
		}

		switch ( indicator )
		{
			case '':
				text = text.replace(/\n+$/g, "\n");
				break;
			case '+':
				break;
			case '-':
				text = text.replace(/\n+$/g, '');
				break;
		}

		return text;
	}
function(separator, indicator, indentation)
	{
		if ( indicator == undefined ) indicator = '';
		if ( indentation == undefined ) indentation = 0;
		
		separator = '|' == separator ? "\n" : ' ';
		var text = '';
		var diff = null;

		var notEOF = this.moveToNextLine();

		while ( notEOF && this.isCurrentLineBlank() )
		{
			text += "\n";

			notEOF = this.moveToNextLine();
		}

		if ( !notEOF )
		{
			return '';
		}

		var matches = null;
		if ( !(matches = new RegExp('^('+(indentation ? this.strRepeat(' ', indentation) : ' +')+')(.*)$').exec(this.currentLine)) )
		{
			this.moveToPreviousLine();

			return '';
		}
		
		matches = {indent: matches[1], text: matches[2]};
		
		var textIndent = matches.indent;
		var previousIndent = 0;

		text += matches.text + separator;
		while ( this.currentLineNb + 1 < this.lines.length )
		{
			this.moveToNextLine();
			
			if ( matches = new RegExp('^( {'+textIndent.length+',})(.+)$').exec(this.currentLine) )
			{
				matches = {indent: matches[1], text: matches[2]};
				
				if ( ' ' == separator && previousIndent != matches.indent )
				{
					text = text.substr(0, text.length - 1)+"\n";
				}
				
				previousIndent = matches.indent;

				diff = matches.indent.length - textIndent.length;
				text += this.strRepeat(' ', diff) + matches.text + (diff != 0 ? "\n" : separator);
			}
			else if ( matches = /^( *)$/.exec(this.currentLine) )
			{
				text += matches[1].replace(new RegExp('^ {1,'+textIndent.length+'}','g'), '')+"\n";
			}
			else
			{
				this.moveToPreviousLine();

				break;
			}
		}

		if ( ' ' == separator )
		{
			// replace last separator by a newline
			text = text.replace(/ (\n*)$/g, "\n$1");
		}

		switch ( indicator )
		{
			case '':
				text = text.replace(/\n+$/g, "\n");
				break;
			case '+':
				break;
			case '-':
				text = text.replace(/\n+$/g, '');
				break;
		}

		return text;
	}
function ( separator , indicator , indentation ) { if ( indicator == undefined ) indicator = '' ; if ( indentation == undefined ) indentation = 0 ; separator = '|' == separator ? "\n" : ' ' ; var text = '' ; var diff = null ; var notEOF = this . moveToNextLine ( ) ; while ( notEOF && this . isCurrentLineBlank ( ) ) { text += "\n" ; notEOF = this . moveToNextLine ( ) ; } if ( ! notEOF ) { return '' ; } var matches = null ; if ( ! ( matches = new RegExp ( '^(' + ( indentation ? this . strRepeat ( ' ' , indentation ) : ' +' ) + ')(.*)$' ) . exec ( this . currentLine ) ) ) { this . moveToPreviousLine ( ) ; return '' ; } matches = { indent : matches [ 1 ] , text : matches [ 2 ] } ; var textIndent = matches . indent ; var previousIndent = 0 ; text += matches . text + separator ; while ( this . currentLineNb + 1 < this . lines . length ) { this . moveToNextLine ( ) ; if ( matches = new RegExp ( '^( {' + textIndent . length + ',})(.+)$' ) . exec ( this . currentLine ) ) { matches = { indent : matches [ 1 ] , text : matches [ 2 ] } ; if ( ' ' == separator && previousIndent != matches . indent ) { text = text . substr ( 0 , text . length - 1 ) + "\n" ; } previousIndent = matches . indent ; diff = matches . indent . length - textIndent . length ; text += this . strRepeat ( ' ' , diff ) + matches . text + ( diff != 0 ? "\n" : separator ) ; } else if ( matches = / ^( *)$ / . exec ( this . currentLine ) ) { text += matches [ 1 ] . replace ( new RegExp ( '^ {1,' + textIndent . length + '}' , 'g' ) , '' ) + "\n" ; } else { this . moveToPreviousLine ( ) ; break ; } } if ( ' ' == separator ) { // replace last separator by a newline text = text . replace ( /  (\n*)$ / g , "\n$1" ) ; } switch ( indicator ) { case '' : text = text . replace ( / \n+$ / g , "\n" ) ; break ; case '+' : break ; case '-' : text = text . replace ( / \n+$ / g , '' ) ; break ; } return text ; }
Parses a folded scalar.

@param	string	separator	 The separator that was used to begin this folded scalar (| or >)
@param	string	indicator	 The indicator that was used to begin this folded scalar (+ or -)
@param	integer indentation  The indentation that was used to begin this folded scalar

@return string	The text value
Parses a folded scalar .