Skip to content

Commit

Permalink
Merge pull request #149 from iljapostnovs/development
Browse files Browse the repository at this point in the history
escape string single quotes
  • Loading branch information
iljapostnovs committed Apr 14, 2024
2 parents 3c7c552 + c45cce9 commit e0ac450
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.15.1 (14-04-2024)

- `XMLFormatter` now escapes single quote character in attribute value, if it is an object

## 1.15.0 (27-01-2024)

- `WrongOverrideLinter` now checks if member is deprecated
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ui5plugin-linter",
"version": "1.15.0",
"version": "1.15.1",
"description": "UI5 Class linter",
"main": "dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/classes/formatter/xml/XMLFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export class XMLFormatter {
} else if (typeof value === "object") {
formattedAttribute += `${this._formatAttributeObject(value, indentation + this._indentation)}`;
} else if (typeof value === "string") {
formattedAttribute += `'${value.replace(/\\/g, "\\\\")}'`;
formattedAttribute += `'${value.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
} else if (typeof value === "function") {
throw new Error("Parsing error");
} else {
Expand Down

0 comments on commit e0ac450

Please sign in to comment.