I’m working on a very simple plugin to perform simple textual replacements in a Discourse post. Specifically, when a user types
/keyword in a post, I want to replace that sequence with an arbitrary string (in this case, a kaomoji, so that I can map
¯\_(ツ)_/¯). Yes, it’s very silly.
shrug:¯\_(ツ)_/¯, but that gives me back a string of
| seperated strings, which is problematic when working with values like kaomoji that are highly likely to contain
| in them.
I could hack around this by disallowing
| in the mapping and splitting the list myself, but before I do, I thought I’d ask if there were a better way than “list” to do what I’m talking about. Is there any reasonable way to create and edit set of key-value pairs through a plugin’s settings? What’s the best way to approach this for both ease of editing and maximum permissiveness in the allowed characters?