Made this cool library that modifies XML code.
It doesn’t modify Snap! XML code directly, but creates XML nodes from scratch, like this:
<name />
<node attribute="value">
text (child)
<escape>
<empty />
<coolio xml:space="preserve">
the spaces matter now
</coolio>
<node>
I’m expirementing with using TextMorphs for cool displays, so check it out here!
fun fact: in custom blocks, you can both use and modify the inputs’ values within their definitons
i’m mentioning this because i saw a set [text V] to (#1) in the definition for (new node [] [] [])
to be fair, there were alot of blocks under it, that modified the text variable
I don’t really want to replace every text variable individually
edit: just realized i can rename the text variable to ‘#1’, replacing all instances of ‘text’ with ‘#1’, and then i can delete the temporary variable ‘#1’, while keeping the input slot ‘#1’ intact