From f12075551de43467d7b6860b7e72272741b3b217 Mon Sep 17 00:00:00 2001 From: Chris Seufert Date: Mon, 17 Oct 2022 23:56:46 +1100 Subject: [PATCH] WIP Fix for multiple inline expressions Currently breaks outputing an inline comment closes #2022 --- src/printer.js | 11 +++++++---- tests/inline/__snapshots__/jsfmt.spec.js.snap | 15 +++++++++++++++ tests/inline/shorthand-2.php | 1 + 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 tests/inline/shorthand-2.php diff --git a/src/printer.js b/src/printer.js index f0bf26687..445b9baae 100644 --- a/src/printer.js +++ b/src/printer.js @@ -1034,10 +1034,13 @@ function printLines(path, options, print, childrenAttribute = "children") { } if (isInlineNode) { - const openTag = - nextNode && nextNode.kind === "echo" && nextNode.shortForm - ? ""])); + return; + } + const openTag = shortOpenTag ? " + +=====================================output===================================== + + +================================================================================ +`; diff --git a/tests/inline/shorthand-2.php b/tests/inline/shorthand-2.php new file mode 100644 index 000000000..07c01c848 --- /dev/null +++ b/tests/inline/shorthand-2.php @@ -0,0 +1 @@ +