mirror of
https://github.com/google/blockly.git
synced 2026-01-07 17:10:11 +01:00
Fix regular expressions.
1) Simplifications.
2) Enable toolbox category colours to be specified using the full range of CSS formats (not just hue or #rrggbb).
3) Fix bug where `Blockly.utils.checkMessageReferences('%{BKY_today} %{BKY_xxx}')` returns true.
This commit is contained in:
@@ -399,7 +399,7 @@ Blockly.Variables.promptName = function(promptText, defaultText, callback) {
|
||||
// Merge runs of whitespace. Strip leading and trailing whitespace.
|
||||
// Beyond this, all names are legal.
|
||||
if (newVar) {
|
||||
newVar = newVar.replace(/[\s\xa0]+/g, ' ').replace(/^ | $/g, '');
|
||||
newVar = newVar.replace(/[\s\xa0]+/g, ' ').trim();
|
||||
if (newVar == Blockly.Msg['RENAME_VARIABLE'] ||
|
||||
newVar == Blockly.Msg['NEW_VARIABLE']) {
|
||||
// Ok, not ALL names are legal...
|
||||
|
||||
Reference in New Issue
Block a user