Scratch-blocks: A cool ghost of the input area appears when you put zalgo in a block

Created on 10 Nov 2017  ·  7Comments  ·  Source: LLK/scratch-blocks

Expected Behavior

Dialog box should appear saying "Please stop trying to break our interface using Zalgo"

Actual Behavior

There is an extra input floating above the real input
image

Steps to Reproduce

Paste s̠̱̥̮͎̗̙̮̗̒͆͂̊̎͑̊̚͟q̶̹̗͚̯̪̰̭̭̘͈̞̖̺͍̥̠̮̰͇ͭͮ̍̏̎͆͆̀̒ͯ͊̽̓́͘v̶̧̨̰̫͙̮͇̪̼̠̌ͭ͋̎͆ͥ̌̂̒ͬͤ̈́̈́̂͜͠i̢͐̏̓̾̚̚҉̡͇̘̹͈̯̙̝͙͙̱̠͕ṙͥ̒͗̎̆ͣ̒ͯ͑̆̐̾͏̵̘͖͎̘͉͎̘̬͔̹͜͠ͅͅŗ͒ͯ̾ͨ̽̎ͨ̚͢͏̘̼̦̤̫͉͕̬͎͎̜̝̘̝̗̥̩͜e̷̛̤͍͎̼̯̱͇̗̹͉̻͐ͩ͒̄ͩ̊ͣ̋ͧ̿͐̊̒̽͊̚͡l̴ͦͫ̃͊͆ͨ͗ͩ̍͊҉̜͇̜̲̞̠̳̰͚̙̱̺͠͡ͅ into a block with an input

Operating System and Browser

Windows 10 Chrome

bug help wanted

Most helpful comment

The Scratch cat can handle it though!

image

All 7 comments

I blame @tmickel

The Scratch cat can handle it though!

image

Mac Chrome 61... All the codepoints are present, and the speak bubble goes offscreen, but the editor never shifts away from the block field.

screen shot 2017-11-09 at 3 50 18 pm

I'm the originator of this bug, I assumed that all text was roughly the same height.

If anyone feels like fixing this (it's an upstream bug in Blockly) it's actually not as hard as it looks. The (relatively recent) addition of image fields required that height be respected for all elements. So the layout algorithm doesn't need changes.

The root issue is this line in field.js:

  this.size_ = new goog.math.Size(0, Blockly.BlockSvg.MIN_BLOCK_Y);

It should be Size(0,0) and then text-based subclasses of Field set the computed height.

Of course if this bug is fixed, the next one to be filed will be that a block with two text labels, one with Zalgo above the text, one with Zalgo below the text, will not have the texts aligned with each other at the baseline. That bug would be awful to try to fix.

Do we really need to support this?

@kyleplo We don't need it if we can assume kids do rationale things.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tmickel picture tmickel  ·  3Comments

gengshenghong picture gengshenghong  ·  3Comments

rachel-fenichel picture rachel-fenichel  ·  4Comments

picklesrus picture picklesrus  ·  3Comments

thisandagain picture thisandagain  ·  6Comments