diff --git a/lib/loader.js b/lib/loader.js index 692b1d3d..25abc808 100644 --- a/lib/loader.js +++ b/lib/loader.js @@ -902,13 +902,6 @@ function readBlockScalar(state, nodeIndent) { continue; } - // Zero-indentation block scalar is not allowed. - // If textIndent is still 0 at this point, it means no explicit indentation - // indicator was given and no indentation was detected in content lines. - if (!detectedIndent && textIndent === 0) { - throwError(state, 'missing indentation for block scalar'); - } - // End of the scalar. if (state.lineIndent < textIndent) { diff --git a/test/issues/0144.js b/test/issues/0144.js index 1abc90c9..4abfb6a9 100644 --- a/test/issues/0144.js +++ b/test/issues/0144.js @@ -1,10 +1,10 @@ 'use strict'; + var assert = require('assert'); var yaml = require('../../'); it('Infinite loop when attempting to parse multi-line scalar document that is not indented', function () { - // Block scalar with zero indentation should throw an error (issue #280) - assert.throws(() => yaml.load('--- |\nfoo\n'), /missing indentation for block scalar/); + assert.strictEqual(yaml.load('--- |\nfoo\n'), 'foo\n'); });