Skip to content

Commit

Permalink
XML格式化
Browse files Browse the repository at this point in the history
  • Loading branch information
super_wang committed Jul 21, 2024
1 parent e333f86 commit cb1863a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/tools/XmlFormat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ const pretty = async () => {
let instance = aceRef.value.getAceInstance();
let selected = instance.getSelectedText();
if (selected) {
instance.session.replace(instance.selection.getRange(), xmlFormat(selected.replace(/[\s+\\n]/g, '')));
instance.session.replace(instance.selection.getRange(), xmlFormat(selected.replace(/[\\n\\r\\t]/g, '')));
} else {
// debugger
console.log(content.value.replace(/[\s+\\n]/g, ''));
content.value = xmlFormat(content.value.replace(/[\s+\\n]/g, ''));
content.value = xmlFormat(content.value.replace(/[\\n\\r\\t]/g, ''));
}
}
Expand Down

0 comments on commit cb1863a

Please sign in to comment.