Commits

Rune Halvorsen committed 70c0b7c

Fixed boolean attribute support in coffeescript impl

  • Participants
  • Parent commits 13d0e22

Comments (0)

Files changed (1)

File linenoise.coffee

     ele
 
 _parseAttributes = (attrtoken, env) ->
-    attrtoken = _strip(attrtoken.slice 1, -1)
+    attrtoken = _strip(attrtoken.slice(1, -1))
     attrs = {}
 
     for [name, value] in attrtoken.split(/\s*,\s*/).map((e) -> e.split(/\s*=\s*/))
-        attrs[name] = _interpolate value, env
+        attrs[name] = _interpolate(value ||"", env)
     attrs
 
 _tokenize = (noisestring) ->
     pretokens = noisestring.split(/(?=[\.\+\>< ^])(".+?")(?![\.\+\>< $])/)
 
     while (token = pretokens.shift())
-        if token[0] is '"' then tokens.push token
+        if token[0] is '"' then tokens.push(token)
         else tokens = tokens.concat(token.split(/([\+><])/))
 
     tokens.map(_strip).filter((e) -> e isnt "")