From e6ca8f597fc80c9d4f15ab9540eecdde8f9dedc5 Mon Sep 17 00:00:00 2001 From: Josh Johnson Date: Sat, 25 Jul 2020 22:17:47 -0400 Subject: [PATCH 1/2] Add Tests for Issue #294 --- src/test/extension.test.ts | 4 ++++ src/test/test-data/issue-294.formatted.xml | 7 +++++++ src/test/test-data/issue-294.unformatted.xml | 7 +++++++ 3 files changed, 18 insertions(+) create mode 100644 src/test/test-data/issue-294.formatted.xml create mode 100644 src/test/test-data/issue-294.unformatted.xml diff --git a/src/test/extension.test.ts b/src/test/extension.test.ts index dc4e04d..c2e20dd 100644 --- a/src/test/extension.test.ts +++ b/src/test/extension.test.ts @@ -107,6 +107,10 @@ describe("V2XmlFormatter", () => { it("should not add trailing whitespace", () => { testFormatter(xmlFormatter, options, "issue-288"); }); + + it("should handle mixed content on the same line as another element", () => { + testFormatter(xmlFormatter, options, "issue-294"); + }); }); describe("#minifyXml(xml, options)", () => { diff --git a/src/test/test-data/issue-294.formatted.xml b/src/test/test-data/issue-294.formatted.xml new file mode 100644 index 0000000..0d46e60 --- /dev/null +++ b/src/test/test-data/issue-294.formatted.xml @@ -0,0 +1,7 @@ + + +
+ ThisCausesBug + +
+
\ No newline at end of file diff --git a/src/test/test-data/issue-294.unformatted.xml b/src/test/test-data/issue-294.unformatted.xml new file mode 100644 index 0000000..2fdc9de --- /dev/null +++ b/src/test/test-data/issue-294.unformatted.xml @@ -0,0 +1,7 @@ + + +
+ ThisCausesBug + +
+
\ No newline at end of file From e9ba54d3b841cf474f26659503ebe0ecfe047eb2 Mon Sep 17 00:00:00 2001 From: Josh Johnson Date: Sat, 25 Jul 2020 22:26:22 -0400 Subject: [PATCH 2/2] Add "Get Current XPath" to Editor Context Menu closes #284 --- package.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ca89fab..c927a94 100644 --- a/package.json +++ b/package.json @@ -245,6 +245,11 @@ "command": "xmlTools.minifyXml", "group": "1_modification@100", "when": "editorLangId == 'xml'" + }, + { + "command": "xmlTools.getCurrentXPath", + "group": "z_commands", + "when": "editorLangId == 'xml'" } ] }, @@ -280,4 +285,4 @@ "xpath": "0.0.27", "xqlint": "^0.4.1" } -} +} \ No newline at end of file