kopia lustrzana https://github.com/backface/turtlestitch
Merge pull request #548 from Gubolin/issue_361
allow percent symbols in custom block texts (fix #361), thanks again @Gubolin, both for the fix and for your patience!pull/3/merge
commit
21b941012c
4
byob.js
4
byob.js
|
@ -227,7 +227,7 @@ CustomBlockDefinition.prototype.blockSpec = function () {
|
||||||
parts = this.parseSpec(this.spec),
|
parts = this.parseSpec(this.spec),
|
||||||
spec;
|
spec;
|
||||||
parts.forEach(function (part) {
|
parts.forEach(function (part) {
|
||||||
if (part[0] === '%') {
|
if (part[0] === '%' && part.length > 1) {
|
||||||
spec = myself.typeOf(part.slice(1));
|
spec = myself.typeOf(part.slice(1));
|
||||||
} else {
|
} else {
|
||||||
spec = part;
|
spec = part;
|
||||||
|
@ -311,7 +311,7 @@ CustomBlockDefinition.prototype.inputNames = function () {
|
||||||
var vNames = [],
|
var vNames = [],
|
||||||
parts = this.parseSpec(this.spec);
|
parts = this.parseSpec(this.spec);
|
||||||
parts.forEach(function (part) {
|
parts.forEach(function (part) {
|
||||||
if (part[0] === '%') {
|
if (part[0] === '%' && part.length > 1) {
|
||||||
vNames.push(part.slice(1));
|
vNames.push(part.slice(1));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Ładowanie…
Reference in New Issue