fix empty attr
This commit is contained in:
parent
c8ec1022f2
commit
170d525aa5
1 changed files with 2 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
Mithril = m = new function app(window) {
|
||||
var selectorCache = {}
|
||||
var type = {}.toString
|
||||
var parser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[.+?\])/g, attrParser = /\[(.+?)(?:=("|'|)(.+?)\2)?\]/
|
||||
var parser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[.+?\])/g, attrParser = /\[(.+?)(?:=("|'|)(.*?)\2)?\]/
|
||||
|
||||
function m() {
|
||||
var args = arguments
|
||||
|
|
@ -18,7 +18,7 @@ Mithril = m = new function app(window) {
|
|||
else if (match[1] == ".") classes.push(match[2])
|
||||
else if (match[3][0] == "[") {
|
||||
var pair = attrParser.exec(match[3])
|
||||
cell.attrs[pair[1]] = pair[3] || true
|
||||
cell.attrs[pair[1]] = pair[3] || (pair[2] ? "" :true)
|
||||
}
|
||||
}
|
||||
if (classes.length > 0) cell.attrs[classAttrName] = classes.join(" ")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue