-
Notifications
You must be signed in to change notification settings - Fork 644
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: bring back support for deprecated string literal spread attributes
- Loading branch information
1 parent
b2e70bc
commit 4bdb32d
Showing
22 changed files
with
318 additions
and
234 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
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,16 @@ | ||
"use strict"; | ||
|
||
var attrs = require("./attrs"); | ||
|
||
/** | ||
* Merges attribute objects into a object. | ||
*/ | ||
module.exports = function mergeAttrs() { | ||
var len = arguments.length; | ||
var result = {}; | ||
for (var i = 0; i < len; i++) { | ||
Object.assign(result, attrs(arguments[i])); | ||
} | ||
|
||
return result; | ||
}; |
3 changes: 1 addition & 2 deletions
3
packages/marko/test/render/fixtures/attr-newline-escaped/expected.html
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
<div class="foo | ||
bar"></div> | ||
<div class="foo bar"></div> |
3 changes: 1 addition & 2 deletions
3
packages/marko/test/render/fixtures/attr-newline-escaped/vdom-expected.html
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
<DIV class="foo | ||
bar"> | ||
<DIV class="foo bar"> |
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 |
---|---|---|
@@ -1 +1 @@ | ||
<div style="background-color: #FF0000; <test>" class=my-div checked data-encoding='"hello"'>Hello World!</div> | ||
<div data-encoding='"hello"' style="background-color: #FF0000; <test>" class=my-div checked>Hello World!</div> |
2 changes: 1 addition & 1 deletion
2
packages/marko/test/render/fixtures/spread-attribute-no-mutate/expected.html
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 |
---|---|---|
@@ -1 +1 @@ | ||
<div id="dom" class="test"></div>{"hidden":false,"id":"custom","class":"test"}<div id="dom" class="test"></div> | ||
<div class=test id=dom></div>{"hidden":false,"id":"custom","class":"test"}<div class=test id=dom></div> |
2 changes: 1 addition & 1 deletion
2
packages/marko/test/render/fixtures/spread-attribute-order-html-tag/expected.html
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 |
---|---|---|
@@ -1 +1 @@ | ||
<div class="test" id="override">Hello spread</div> | ||
<div id=override class=test>Hello spread</div> |
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
Oops, something went wrong.