Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@prettier/plugin-pug

Package Overview
Dependencies
Maintainers
12
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prettier/plugin-pug - npm Package Compare versions

Comparing version 1.16.0 to 1.16.1-0

10

CHANGELOG.md
# Next
[diff](https://github.com/prettier/plugin-pug/compare/1.16.0...main)
[diff](https://github.com/prettier/plugin-pug/compare/1.16.1...main)
# 1.16.1
[diff](https://github.com/prettier/plugin-pug/compare/1.16.0...1.16.1)
- Prevent wrong quotation ([#255])
[#255]: https://github.com/prettier/plugin-pug/issues/255
# 1.16.0

@@ -6,0 +14,0 @@

8

package.json
{
"name": "@prettier/plugin-pug",
"version": "1.16.0",
"version": "1.16.1-0",
"description": "Prettier Pug Plugin",

@@ -43,4 +43,4 @@ "main": "dist/index.js",

"@types/jest": "~26.0.24",
"@types/node": "~16.0.0",
"@types/prettier": "~2.3.1",
"@types/node": "~16.3.1",
"@types/prettier": "~2.3.2",
"@typescript-eslint/eslint-plugin": "~4.28.2",

@@ -53,3 +53,3 @@ "@typescript-eslint/parser": "~4.28.2",

"eslint-plugin-inclusive-language": "~2.1.1",
"eslint-plugin-jsdoc": "~35.4.1",
"eslint-plugin-jsdoc": "~35.4.3",
"eslint-plugin-prettier": "~3.4.0",

@@ -56,0 +56,0 @@ "eslint-plugin-spellcheck": "~0.0.19",

@@ -919,27 +919,31 @@ import type { BuiltInParserName, Options, RequiredOptions } from 'prettier';

val = this.formatStyleAttribute(val);
} else if (isQuoted(val)) {
val = makeString(val.slice(1, -1), this.quotes);
} else if (val === 'true') {
// The value is exactly true and is not quoted
return;
} else if (token.mustEscape) {
val = format(val, { parser: '__js_expression', ...this.codeInterpolationOptions });
} else {
// Prevent wrong quotation if there is an extra whitespace at the end
const rightTrimmedVal: string = val.trimRight();
if (isQuoted(rightTrimmedVal)) {
val = makeString(rightTrimmedVal.slice(1, -1), this.quotes);
} else if (val === 'true') {
// The value is exactly true and is not quoted
return;
} else if (token.mustEscape) {
val = format(val, { parser: '__js_expression', ...this.codeInterpolationOptions });
const lines: string[] = val.split('\n');
const codeIndentLevel: number = this.wrapAttributes ? this.indentLevel + 1 : this.indentLevel;
if (lines.length > 1) {
val = lines[0] ?? '';
for (let index: number = 1; index < lines.length; index++) {
val += '\n';
val += this.indentString.repeat(codeIndentLevel);
val += lines[index];
const lines: string[] = val.split('\n');
const codeIndentLevel: number = this.wrapAttributes ? this.indentLevel + 1 : this.indentLevel;
if (lines.length > 1) {
val = lines[0] ?? '';
for (let index: number = 1; index < lines.length; index++) {
val += '\n';
val += this.indentString.repeat(codeIndentLevel);
val += lines[index];
}
}
} else {
// The value is not quoted and may be js-code
val = val.trim();
val = val.replace(/\s\s+/g, ' ');
if (val[0] === '{' && val[1] === ' ') {
val = `{${val.slice(2, val.length)}`;
}
}
} else {
// The value is not quoted and may be js-code
val = val.trim();
val = val.replace(/\s\s+/g, ' ');
if (val[0] === '{' && val[1] === ' ') {
val = `{${val.slice(2, val.length)}`;
}
}

@@ -946,0 +950,0 @@

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc