vorple / inform7

Inform 7 extensions and templates
Other
9 stars 4 forks source link

In JS commands, text substitutions after a period may cause unwanted linebreaks #19

Closed Natrium729 closed 6 years ago

Natrium729 commented 6 years ago

If you have a to say phrase that outputs some JavaScript identifier, you can't use it after a period (e.g. to retrieve a key from an object) because Inform automatically adds linebreaks after periods.

To say my JS identifier:
    say "myId".

[This will fail.]
execute JavaScript command "myObject.[my JS identifier];".

It can be solved by adding -- running on after the to say phrase:

To say my JS identifier -- running on:
    say "myId".

I don't think it can be solved on Vorple's side, but maybe a line in the documentation about this issue should be added? Because it took me a lot of time to find why my code wasn't working.

And if ever there are some text substitutions of this kind in Vorple extensions, we should be sure to mark them as running on.

juhana commented 6 years ago

This is true, although thankfully it happens only with say phrases that contain punctuation. The web site documentation will contain discussion about the topic when the next version is released.