scratchfoundation / scratch-blocks

Scratch Blocks is a library for building creative computing interfaces.
https://scratch.mit.edu/developers
Apache License 2.0
2.58k stars 1.37k forks source link

Fix collapse when creating a custom procedure with % in label #3244

Open alexcui03 opened 4 months ago

alexcui03 commented 4 months ago

Resolves

Proposed Changes

Add a escape for % when adding a label in procedure declaration block.

Reason for Changes

This pull request fixed the collapse when creating a custom procedure with % in a label. In the function Blockly.ScratchBlocks.ProcedureUtils.updateDeclarationProcCode_, I add escape for % when adding a label to ensure all %s in label should be \% in procCode, because Scratch treats \% in procCode as a escape of %. (see blocks_vertical/procedures.js#L207)

Test Coverage

None.