Socket
Socket
Sign inDemoInstall

js-yaml

Package Overview
Dependencies
4
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.1 to 2.1.2

6

HISTORY.md

@@ -0,1 +1,7 @@

2.1.2 / 2013-10-07
------------------
- Fix unwanted line breaks in folded scalars.
2.1.1 / 2013-10-02

@@ -2,0 +8,0 @@ ------------------

23

lib/js-yaml/loader.js

@@ -748,3 +748,4 @@ 'use strict';

textIndent = nodeIndent,
emptyLines = -1;
emptyLines = -1,
atMoreIndented = false;

@@ -835,18 +836,30 @@ switch (character) {

// Folded style: use fancy rules to handle line breaks.
if (folding) {
// Lines starting with white space characters (more-indented lines) are not folded.
if (CHAR_SPACE === character || CHAR_TAB === character) {
atMoreIndented = true;
result += common.repeat('\n', emptyLines + 1);
emptyLines = 1;
// End of more-indented block.
} else if (atMoreIndented) {
atMoreIndented = false;
result += common.repeat('\n', emptyLines + 1);
// Just one line break - perceive as the same line.
} else if (0 === emptyLines) {
result += ' ';
emptyLines = 0;
// Several line breaks - perceive as different lines.
} else {
result += common.repeat('\n', emptyLines);
emptyLines = 0;
}
// Literal style: just add exact number of line breaks between content lines.
} else {
result += common.repeat('\n', emptyLines + 1);
emptyLines = 0;
}
emptyLines = 0;
captureStart = position;

@@ -853,0 +866,0 @@

{
"name" : "js-yaml",
"version" : "2.1.1",
"version" : "2.1.2",
"description" : "YAML 1.2 parser and serializer",

@@ -5,0 +5,0 @@ "keywords" : ["yaml", "parser", "serializer", "pyyaml"],

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc