summaryrefslogtreecommitdiff
path: root/byob.js
diff options
context:
space:
mode:
authornatashasandy <natashasandy@berkeley.edu>2014-10-21 18:03:15 -0700
committernatashasandy <natashasandy@berkeley.edu>2014-10-21 18:03:15 -0700
commit413e6a0e6a884ef9811221a3f92353f1d3fa6544 (patch)
tree49f91d665dae7fda7ce6ff8d994e88cb7d213f87 /byob.js
parent5f3279990be3478fde79b94f7dbd5d7da80df84b (diff)
downloadsnap-byow-413e6a0e6a884ef9811221a3f92353f1d3fa6544.tar.gz
snap-byow-413e6a0e6a884ef9811221a3f92353f1d3fa6544.zip
Fixed percent symbols in custom blocks
This fixes issue #476
Diffstat (limited to 'byob.js')
-rw-r--r--byob.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/byob.js b/byob.js
index 1277bb6..71b3298 100644
--- a/byob.js
+++ b/byob.js
@@ -688,7 +688,8 @@ CustomCommandBlockMorph.prototype.labelPart = function (spec) {
return CustomCommandBlockMorph.uber.labelPart.call(this, spec);
}
if ((spec[0] === '%') && (spec.length > 1)) {
- part = new BlockInputFragmentMorph(spec.slice(1));
+ var label = spec.replace(/%/g, '');
+ part = new BlockInputFragmentMorph(label);
} else {
part = new BlockLabelFragmentMorph(spec);
part.fontSize = this.fontSize;