Skip to content

Commit 50a8a52

Browse files
muandgraham
andauthored
Trim spaces before/after
Co-authored-by: David Graham <dgraham@github.com>
1 parent ce2218a commit 50a8a52

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/bind.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ 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(/\s+/)) {
77-
if (!action) continue
76+
for (const action of (el.getAttribute('data-action') || '').trim().split(/\s+/)) {
7877
const eventSep = action.lastIndexOf(':')
7978
const methodSep = action.lastIndexOf('#')
8079
const type = action.slice(0, eventSep)

0 commit comments

Comments
 (0)