Skip to content

Commit 2862d97

Browse files
committed
do not copy attributes containing special chars during transclusion
1 parent 59b364a commit 2862d97

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/compiler/transclude.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var _ = require('../util')
22
var config = require('../config')
33
var templateParser = require('../parsers/template')
4+
var specialCharRE = /[#@\*\$\.]/
45

56
/**
67
* Process an element or a DocumentFragment based on a
@@ -134,7 +135,7 @@ function mergeAttrs (from, to) {
134135
while (i--) {
135136
name = attrs[i].name
136137
value = attrs[i].value
137-
if (!to.hasAttribute(name)) {
138+
if (!to.hasAttribute(name) && !specialCharRE.test(name)) {
138139
to.setAttribute(name, value)
139140
} else if (name === 'class') {
140141
value = to.getAttribute(name) + ' ' + value

0 commit comments

Comments
 (0)