parent
1015e19253
commit
a67f6f8d83
@ -19,7 +19,13 @@ export function textToXml(textEditor: TextEditor): void {
|
||||
);
|
||||
}
|
||||
const txt = textEditor.document.getText(new Range(selection.start, selection.end));
|
||||
const transformed = txt.replace(/</g, "<").replace(/>/g, ">");
|
||||
const transformed = txt
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/&/g, "&")
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, "'");
|
||||
|
||||
textEdit.replace(selection, transformed);
|
||||
});
|
||||
});
|
||||
|
@ -19,7 +19,13 @@ export function xmlToText(textEditor: TextEditor): void {
|
||||
);
|
||||
}
|
||||
const txt = textEditor.document.getText(new Range(selection.start, selection.end));
|
||||
const transformed = txt.replace(/</g, "<").replace(/>/g, ">");
|
||||
const transformed = txt
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/&/g, "&")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
|
||||
textEdit.replace(selection, transformed);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user