mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Revert "Fixes #705 - Throw error when the root HTML element has a dynamic id …"
This commit is contained in:
parent
4eb20477a2
commit
a998535db7
@ -199,16 +199,9 @@ module.exports = function handleRootNodes() {
|
||||
hasLegacyExplicitBind = true;
|
||||
} else {
|
||||
if (node.hasAttribute('id')) {
|
||||
let id = node.getAttributeValue('id');
|
||||
|
||||
if (id && id.type !== 'Literal') {
|
||||
context.addError('Root HTML element should not have a dynamic `id` attribute. See: https://github.com/marko-js/marko/wiki/Error:-Dynamic-root-HTML-element-id-attribute');
|
||||
return;
|
||||
}
|
||||
|
||||
hasIdCount++;
|
||||
nodeWithAssignedId = node;
|
||||
assignedId = id;
|
||||
assignedId = node.getAttributeValue('id');
|
||||
}
|
||||
|
||||
if (tagName === 'style') {
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
$ var id = 'abc123';
|
||||
|
||||
<div id=id/>
|
||||
@ -1,6 +0,0 @@
|
||||
var expect = require('chai').expect;
|
||||
|
||||
exports.checkError = function(e) {
|
||||
var message = e.toString();
|
||||
expect(message).to.contain('https://github.com/marko-js/marko/wiki/Error:-Dynamic-root-HTML-element-id-attribute');
|
||||
};
|
||||
@ -1 +1 @@
|
||||
<div><div style="color: red;" id="foo-Frank">Hello Frank!</div></div>
|
||||
<div style="color: red;" id="foo-Frank">Hello Frank!</div>
|
||||
@ -1,3 +1,2 @@
|
||||
div
|
||||
div#foo-${input.name} style="color: red;"
|
||||
-- Hello ${input.name}!
|
||||
div#foo-${input.name} style="color: red;"
|
||||
-- Hello ${input.name}!
|
||||
Loading…
x
Reference in New Issue
Block a user