How to put single space in field_input?

41 views
Skip to first unread message

Frank The Tank

unread,
Jun 3, 2021, 8:35:08 AM6/3/21
to Blockly
Using a field_input with leading or trailing spaces around text seems to work fine, but how do I allow someone to define a field_input with *only* a space character?  When I inspect the serialized XML it appears to remove spaces from the XML workspace.

Neil Fraser

unread,
Jun 3, 2021, 12:11:28 PM6/3/21
to blo...@googlegroups.com
Unable to recreate.  Seems to work properly:
There's one space in that input, and there is a space in the XML (as seen in the XML tab).

On Thu, 3 Jun 2021 at 05:35, Frank The Tank <fra...@gmail.com> wrote:
Using a field_input with leading or trailing spaces around text seems to work fine, but how do I allow someone to define a field_input with *only* a space character?  When I inspect the serialized XML it appears to remove spaces from the XML workspace.

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/442945fc-2ff2-445a-9670-30136a2feb41n%40googlegroups.com.


--

Frank The Tank

unread,
Jun 3, 2021, 12:41:20 PM6/3/21
to Blockly
Thanks, you are right.  Apparently this is happening when passing the blockly XML to another parser after serializing.  It looks like XML is a bit loose on whether whitespace should be preserved unless xml:space="preserve" attribute is present?
Reply all
Reply to author
Forward
0 new messages