diff --git a/src/components/d-cite.js b/src/components/d-cite.js index 48917af..4da4388 100644 --- a/src/components/d-cite.js +++ b/src/components/d-cite.js @@ -102,7 +102,7 @@ export class Cite extends T(HTMLElement) { attributeChangedCallback(name, oldValue, newValue) { const eventName = oldValue ? 'onCiteKeyChanged' : 'onCiteKeyCreated'; - const keys = newValue.split(','); + const keys = newValue.split(',').map(k => k.trim()); const options = { detail: [this, keys], bubbles: true }; const event = new CustomEvent(eventName, options); document.dispatchEvent(event);