Skip to content

Commit be91221

Browse files
committed
fix: deprecate the ! char as the escape char
This better aligns with what egineers are used to as the escape key.
1 parent 83ddb67 commit be91221

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function inputHandler(event) {
5151
event.stopPropagation()
5252

5353
// gather some information from the input before masking
54-
let cursorPosition = target.selectionEnd
54+
const cursorPosition = target.selectionEnd
5555
const isCursorAtEnd = event.data && cursorPosition == target.value.length
5656
const digit = target.value[cursorPosition - 1] // last inserted digit
5757

src/tokens.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ export default {
44
S: { pattern: /[a-zA-Z]/ },
55
A: { pattern: /[a-zA-Z]/, transform: (v) => v.toLocaleUpperCase() },
66
a: { pattern: /[a-zA-Z]/, transform: (v) => v.toLocaleLowerCase() },
7-
'!': { escape: true }
7+
'!': { escape: true }, // deprecated, use \ moving forward
8+
'\\': { escape: true }
89
}

0 commit comments

Comments
 (0)