Skip to content

Commit 3a1acc5

Browse files
committed
Split on spaces, lf, tab
1 parent a2fdf41 commit 3a1acc5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/bind.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ function handleEvent(event: Event) {
7373

7474
type Binding = {type: string; tag: string; method: string}
7575
function* bindings(el: Element): Iterable<Binding> {
76-
for (const action of (el.getAttribute('data-action') || '').split(' ')) {
76+
for (const action of (el.getAttribute('data-action') || '').split(/\s+/)) {
77+
if (!action) continue
7778
const eventSep = action.lastIndexOf(':')
7879
const methodSep = action.lastIndexOf('#')
7980
const type = action.slice(0, eventSep)

0 commit comments

Comments
 (0)