Open AShchelygin opened 2 years ago
FIX: .vscode\extensions\dotjoshjohnson.xml-2.5.1\out\formatting\commands\xmlToText.js
Move .replace(/&/g, "&")
to 13 line (& must be first)
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const vscode_1 = require("vscode");
function xmlToText(textEditor) {
textEditor.edit(textEdit => {
const selections = textEditor.selections;
selections.forEach(selection => {
if (selection.isEmpty) {
selection = new vscode_1.Selection(textEditor.document.positionAt(0), textEditor.document.positionAt(textEditor.document.getText().length));
}
const txt = textEditor.document.getText(new vscode_1.Range(selection.start, selection.end));
const transformed = txt
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/"/g, """)
.replace(/'/g, "'");
textEdit.replace(selection, transformed);
});
});
}
exports.xmlToText = xmlToText;
//# sourceMappingURL=xmlToText.js.map
Description
Convert XML to text does not work as advertised.
Fact result: <> -> &lt;&gt; Expected Result: <> -> <>
Formatter Implementation
classic
XML Tools Version
v2.5.1
VS Code Version
1.63.2
Operating System
Windows 7 x64 Pro