Permalink
Browse files

Fixed regexp-matching syntax - single-word commands now (partially) work

  • Loading branch information...
1 parent 8d15acb commit f690bb52a6d6a822834748e1118c48dcd4e29aeb @yozlet committed Sep 21, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 HTML/tokenfield/token.js
View
@@ -226,13 +226,13 @@ tf.tokenPlain.triggerComplete = function (offset, event) {
test = this.contents;
// Split trailing space.
- if (/ $/(test)) {
- test = test.substring(0, test.length - 1);
+ if (test.match(/\s+$/)) {
+ test = test.replace(/\s+$/, "");
out.push(new tf.tokenEmpty());
}
// Special characters must be quoted.
- var type = /[ "'\\]/(test) ? tf.tokenQuoted : tf.tokenPlain;
+ var type = test.match(/[ "'\\]/) ? tf.tokenQuoted : tf.tokenPlain;
out.unshift(new type(test, this.style));
return out;

0 comments on commit f690bb5

Please sign in to comment.