mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Marko v3: Improved handling of invalid attributes
This commit is contained in:
parent
fcd2cad02c
commit
c78ca5f352
@ -267,6 +267,10 @@ class CompileContext {
|
||||
let attrDef = taglibLookup.getAttribute(tagName, attrName);
|
||||
if (!attrDef) {
|
||||
if (tagDef) {
|
||||
if (node.removeAttribute) {
|
||||
node.removeAttribute(attrName);
|
||||
}
|
||||
|
||||
// var isAttrForTaglib = compiler.taglibs.isTaglib(attrUri);
|
||||
//Tag doesn't allow dynamic attributes
|
||||
this.addError({
|
||||
|
||||
@ -131,6 +131,7 @@ function buildInputProps(el, context) {
|
||||
var attrDef = attr.def || context.taglibLookup.getAttribute(el.tagName, attr.name);
|
||||
|
||||
if (!attrDef) {
|
||||
context.addError(el, 'Unsupported attribute of "' + attrName + '" found on the <' + el.tagName + '> custom tag.');
|
||||
return; // Skip over attributes that are not supported
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user