-
Notifications
You must be signed in to change notification settings - Fork 641
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: comments or whitespace between else/else-if tags (#1827)
- Loading branch information
1 parent
5add6c0
commit ae0c003
Showing
10 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@marko/translator-default": patch | ||
--- | ||
|
||
Fix issue where there was whitespace or a comment between else/else-if tags. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...tor-default/test/fixtures/else-tag-with-whitespace-and-comments/snapshots/cjs-expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"use strict"; | ||
|
||
exports.__esModule = true; | ||
exports.default = void 0; | ||
|
||
var _index = require("marko/src/runtime/html/index.js"); | ||
|
||
var _renderer = _interopRequireDefault(require("marko/src/runtime/components/renderer.js")); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
const _marko_componentType = "packages/translator-default/test/fixtures/else-tag-with-whitespace-and-comments/template.marko", | ||
_marko_template = (0, _index.t)(_marko_componentType); | ||
|
||
var _default = _marko_template; | ||
exports.default = _default; | ||
const _marko_component = {}; | ||
_marko_template._ = (0, _renderer.default)(function (input, out, _componentDef, _component, state) { | ||
if (x) {} else if (y) {} else {} | ||
}, { | ||
t: _marko_componentType, | ||
i: true, | ||
d: true | ||
}, _marko_component); |
5 changes: 5 additions & 0 deletions
5
...lt/test/fixtures/else-tag-with-whitespace-and-comments/snapshots/generated-expected.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<if(x)/> | ||
<else-if(y)/> | ||
<!-- Comments are okay also! --> | ||
<!-- Comments are okay also!--> | ||
<else/> |
15 changes: 15 additions & 0 deletions
15
...or-default/test/fixtures/else-tag-with-whitespace-and-comments/snapshots/html-expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { t as _t } from "marko/src/runtime/html/index.js"; | ||
|
||
const _marko_componentType = "packages/translator-default/test/fixtures/else-tag-with-whitespace-and-comments/template.marko", | ||
_marko_template = _t(_marko_componentType); | ||
|
||
export default _marko_template; | ||
import _marko_renderer from "marko/src/runtime/components/renderer.js"; | ||
const _marko_component = {}; | ||
_marko_template._ = _marko_renderer(function (input, out, _componentDef, _component, state) { | ||
if (x) {} else if (y) {} else {} | ||
}, { | ||
t: _marko_componentType, | ||
i: true, | ||
d: true | ||
}, _marko_component); |
14 changes: 14 additions & 0 deletions
14
.../test/fixtures/else-tag-with-whitespace-and-comments/snapshots/htmlProduction-expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { t as _t } from "marko/dist/runtime/html/index.js"; | ||
|
||
const _marko_componentType = "GzjO/FF7", | ||
_marko_template = _t(_marko_componentType); | ||
|
||
export default _marko_template; | ||
import _marko_renderer from "marko/dist/runtime/components/renderer.js"; | ||
const _marko_component = {}; | ||
_marko_template._ = _marko_renderer(function (input, out, _componentDef, _component, state) { | ||
if (x) {} else if (y) {} else {} | ||
}, { | ||
t: _marko_componentType, | ||
i: true | ||
}, _marko_component); |
Empty file.
21 changes: 21 additions & 0 deletions
21
...or-default/test/fixtures/else-tag-with-whitespace-and-comments/snapshots/vdom-expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { t as _t } from "marko/src/runtime/vdom/index.js"; | ||
|
||
const _marko_componentType = "packages/translator-default/test/fixtures/else-tag-with-whitespace-and-comments/template.marko", | ||
_marko_template = _t(_marko_componentType); | ||
|
||
export default _marko_template; | ||
import _marko_renderer from "marko/src/runtime/components/renderer.js"; | ||
import { r as _marko_registerComponent } from "marko/src/runtime/components/registry"; | ||
|
||
_marko_registerComponent(_marko_componentType, () => _marko_template); | ||
|
||
const _marko_component = {}; | ||
_marko_template._ = _marko_renderer(function (input, out, _componentDef, _component, state) { | ||
if (x) {} else if (y) {} else {} | ||
}, { | ||
t: _marko_componentType, | ||
i: true, | ||
d: true | ||
}, _marko_component); | ||
import _marko_defineComponent from "marko/src/runtime/components/defineComponent.js"; | ||
_marko_template.Component = _marko_defineComponent(_marko_component, _marko_template._); |
20 changes: 20 additions & 0 deletions
20
.../test/fixtures/else-tag-with-whitespace-and-comments/snapshots/vdomProduction-expected.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { t as _t } from "marko/dist/runtime/vdom/index.js"; | ||
|
||
const _marko_componentType = "GzjO/FF7", | ||
_marko_template = _t(_marko_componentType); | ||
|
||
export default _marko_template; | ||
import _marko_renderer from "marko/dist/runtime/components/renderer.js"; | ||
import { r as _marko_registerComponent } from "marko/dist/runtime/components/registry"; | ||
|
||
_marko_registerComponent(_marko_componentType, () => _marko_template); | ||
|
||
const _marko_component = {}; | ||
_marko_template._ = _marko_renderer(function (input, out, _componentDef, _component, state) { | ||
if (x) {} else if (y) {} else {} | ||
}, { | ||
t: _marko_componentType, | ||
i: true | ||
}, _marko_component); | ||
import _marko_defineComponent from "marko/dist/runtime/components/defineComponent.js"; | ||
_marko_template.Component = _marko_defineComponent(_marko_component, _marko_template._); |
9 changes: 9 additions & 0 deletions
9
...ges/translator-default/test/fixtures/else-tag-with-whitespace-and-comments/template.marko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<if(x)> | ||
</if> | ||
|
||
<else-if(y)> | ||
</else-if> | ||
<!-- Comments are okay also! --> | ||
// Comments are okay also! | ||
<else> | ||
</else> |