Browse Source

do not copy attributes containing special chars during transclusion

Evan You 10 years ago
parent
commit
2862d97a39
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/compiler/transclude.js

+ 2 - 1
src/compiler/transclude.js

@@ -1,6 +1,7 @@
 var _ = require('../util')
 var config = require('../config')
 var templateParser = require('../parsers/template')
+var specialCharRE = /[#@\*\$\.]/
 
 /**
  * Process an element or a DocumentFragment based on a
@@ -134,7 +135,7 @@ function mergeAttrs (from, to) {
   while (i--) {
     name = attrs[i].name
     value = attrs[i].value
-    if (!to.hasAttribute(name)) {
+    if (!to.hasAttribute(name) && !specialCharRE.test(name)) {
       to.setAttribute(name, value)
     } else if (name === 'class') {
       value = to.getAttribute(name) + ' ' + value