benwebber / tiddlywiki-dnd

Manage D&D campaigns with TiddlyWiki
https://benwebber.github.io/tiddlywiki-dnd/
MIT License
35 stars 8 forks source link

Convert macro arguments #5

Closed benwebber closed 5 years ago

benwebber commented 5 years ago

JavaScript macros receive strings. We expect numbers or Booleans in several places, notably in spell blocks (level, ritual). As-is we currently only consider empty fields false.

We should convert values from user input immediately before passing them to the macro implementation.

Note that even though JSON tiddlers can contain non-string values, TiddlyWiki converts them to strings before passing them to the macro.