Merge remote-tracking branch 'refs/remotes/origin/master' into techdebt

This commit is contained in:
Josh Johnson 2017-06-23 20:50:59 -04:00
commit ce6a965959
2 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@
"name": "xml", "name": "xml",
"displayName": "XML Tools", "displayName": "XML Tools",
"description": "XML Formatting, XQuery, and XPath Tools for Visual Studio Code", "description": "XML Formatting, XQuery, and XPath Tools for Visual Studio Code",
"version": "1.9.1", "version": "1.9.2",
"publisher": "DotJoshJohnson", "publisher": "DotJoshJohnson",
"author": { "author": {
"name": "Josh Johnson", "name": "Josh Johnson",

View File

@ -34,7 +34,7 @@ export class XmlFormatter {
} }
let parts: string[] = xml.split('~::~'); let parts: string[] = xml.split('~::~');
console.log(parts);
let inComment: boolean = false; let inComment: boolean = false;
let level: number = 0; let level: number = 0;
let output: string = ''; let output: string = '';
@ -59,7 +59,7 @@ export class XmlFormatter {
// <elm></elm> // <elm></elm>
else if (/^<(\w|:)/.test(parts[i - 1]) && /^<\/(\w|:)/.test(parts[i]) else if (/^<(\w|:)/.test(parts[i - 1]) && /^<\/(\w|:)/.test(parts[i])
&& /^<[\w:\-\.\,\/ ]+/.exec(parts[i - 1])[0] == /^<\/[\w:\-\.\, ]+/.exec(parts[i])[0].replace('/', '')) { && /^<[\w:\-\.\,\/]+/.exec(parts[i - 1])[0] == /^<\/[\w:\-\.\,]+/.exec(parts[i])[0].replace('/', '')) {
output += parts[i]; output += parts[i];
if (!inComment) level--; if (!inComment) level--;
@ -96,7 +96,7 @@ export class XmlFormatter {
} }
// xmlns // xmlns
else if (parts[i].search(/xmlns\:/) > -1 || parts[i].search(/xmlns\=/) > -1) { else if (this.splitNamespaces && (parts[i].search(/xmlns\:/) > -1 || parts[i].search(/xmlns\=/) > -1)) {
output += this._getIndent(level, parts[i]); output += this._getIndent(level, parts[i]);
} }