diff --git a/README.md b/README.md index 33850fa..1763729 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ With a script tag: - `keys` is a space separated list of menu activation keys - `multiword` defines whether the expansion should use several words or not - you can provide a space separated list of activation keys that should support multi-word matching +- `suffix` is a string that is appended to the value during expansion, default is a single space character ## Events diff --git a/src/text-expander-element.ts b/src/text-expander-element.ts index 1f43c14..73f2b1d 100644 --- a/src/text-expander-element.ts +++ b/src/text-expander-element.ts @@ -125,7 +125,8 @@ class TextExpander { if (canceled) return if (!detail.value) return - const value = `${detail.value} ` + const suffix = this.expander.getAttribute('suffix') ?? ' ' + const value = `${detail.value}${suffix}` this.input.value = beginning + value + remaining