datastar icon indicating copy to clipboard operation
datastar copied to clipboard

Two-way binding encoding modifier

Open Superpat opened this issue 1 year ago • 0 comments

When setting a signal with data-store it can be useful to encode the string, especially when it contains quotes. If this is used by data-model the data in the input will be unreadable.

I suggest a data-model.b64 (possible with uint8array) and maybe a data-model.uricomponent so that the data can be encoded / decoded automatically when it goes from / to the input / signal.

For the record, escaping quotes like ' when serialising data into the data-store works fine with data-model, but there might still be a use case for encoding the data (like handling newlines).

Superpat avatar May 16 '24 04:05 Superpat