diff options
author | Alex Xu <alex_y_xu@yahoo.ca> | 2013-07-31 22:39:36 -0400 |
---|---|---|
committer | Alex Xu <alex_y_xu@yahoo.ca> | 2013-07-31 22:39:36 -0400 |
commit | c4e5c09dbcfa26dde90d9cf8d4e2692e79109d73 (patch) | |
tree | 4a64d57813ae606c27d52e395396755898e07751 /www/js | |
parent | 29618dc9a319643a7f6a27f55435739f573541df (diff) | |
download | html5ks-c4e5c09dbcfa26dde90d9cf8d4e2692e79109d73.tar.xz html5ks-c4e5c09dbcfa26dde90d9cf8d4e2692e79109d73.zip |
fix extend, this time for real
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/api.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/www/js/api.js b/www/js/api.js index 4454521..316c9a6 100644 --- a/www/js/api.js +++ b/www/js/api.js @@ -324,18 +324,25 @@ window.html5ks.api = { w = /{w(=\d*\.\d*)?}/.exec(str); if (!char) { - char = { - name: name, - }; + if (name) { + char = { + name: name, + }; + } else { + char = this._lastchar; + } } if (typeof char.what_prefix === "undefined") { char.what_prefix = "“"; char.what_suffix = "”"; } + + this._lastchar = char; + if (!extend && char.what_prefix) { text = char.what_prefix + text; } - if ((!w || !w[1]) && !extend && char.what_suffix) { + if ((!w || !w[1]) && char.what_suffix) { text = text + char.what_suffix; } |