Make <edit:with> disambiguate bare names to an attribute on the element.
authorCameron McCormack <cam@mcc.id.au>
Thu, 10 Apr 2014 18:15:56 +1000
changeset 85 82c4907ef7c3
parent 84 63ffebec495a
child 86 13b058f3c042
Make <edit:with> disambiguate bare names to an attribute on the element.
publish/definitions.js
--- a/publish/definitions.js	Tue Apr 01 11:14:13 2014 +1100
+++ b/publish/definitions.js	Thu Apr 10 18:15:56 2014 +1000
@@ -273,6 +273,14 @@
   var attribute = elementName && this.elements[elementName].attributes[name] || this.commonAttributes[name];
   var property = this.properties[name];
 
+  if (elementName && attribute) {
+    // Inside an <edit:with>, assume that <a>'name'</a> links refer to an
+    // attribute on the element given on the <edit:with>.  Outside an
+    // <edit:with>, the name must be unambiguous.
+    element = null;
+    property = null;
+  }
+
   if (!attribute && !property) {
     var attrs = findAttributesInCategories(this, name)
                   .concat(findCommonAttributesForElements(this, name));