Skip to content

Commit c5bbf7e

Browse files
committed
Add suffix option to <text-expander>
Fixes: #35
1 parent 5b5f7ad commit c5bbf7e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ With a script tag:
3737
- `keys` is a space separated list of menu activation keys
3838
- `multiword` defines whether the expansion should use several words or not
3939
- you can provide a space separated list of activation keys that should support multi-word matching
40+
- `suffix` is a string that is appended to the value during expansion, default is a single space character
4041
4142
## Events
4243

src/text-expander-element.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ class TextExpander {
125125
if (canceled) return
126126

127127
if (!detail.value) return
128-
const value = `${detail.value} `
128+
const suffix = this.expander.getAttribute('suffix') ?? ' '
129+
const value = `${detail.value}${suffix}`
129130

130131
this.input.value = beginning + value + remaining
131132

0 commit comments

Comments
 (0)