Skip to content

Commit

Permalink
Fixes #26
Browse files Browse the repository at this point in the history
  • Loading branch information
ixti committed Dec 16, 2011
1 parent b10f53d commit 833d791
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ lint:
# (white) -> tolerate messy whitespace
jslint --node --nomen --bitwise --white --indent=2 ${JS_FILES}

test: test-issues test-functional
test: lint test-issues test-functional

test-functional:
echo
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
JS-YAML - YAML 1.1 parser for JavaScript
========================================

[![Build Status](https://secure.travis-ci.org/nodeca/js-yaml.png)](http://travis-ci.org/nodeca/js-yaml)

[Online Demo](http://nodeca.github.com/js-yaml/)

This is a native port of [PyYAML](http://pyyaml.org/), the most advanced YAML parser.
Expand Down
4 changes: 2 additions & 2 deletions lib/js-yaml/scanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -1318,9 +1318,9 @@ Scanner.prototype.scanBlockScalar = function scanBlockScalar(style) {
// Unfortunately, folding rules are ambiguous.
//
// This is the folding according to the specification:

if (folded && lineBreak === '\n' && leadingNonSpace && -1 === ' \t'.indexOf(this.peek())) {
if (!breaks) {
if (!breaks || !breaks.length) {
chunks.push(' ');
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions test/issues/issue-26.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ var issue = module.exports = {},
source = __dirname + '/data/issue-26.yml';

issue.title = "#26: should convert new line into white space";
issue.fixed = false;
issue.fixed = true;
issue.execute = function () {
var doc = require(source).shift();
assert.equal(doc.test, 'a b c');
assert.equal(doc.test, 'a b c\n');
};

0 comments on commit 833d791

Please sign in to comment.