Parses a Pandoc-style attribute string into an object.
Supports the following patterns:
.className
{ class: 'className' }
#myId
{ id: 'myId' }
key="value"
{ key: 'value' }
disabled
{ disabled: true }
The attribute string to parse
Parsed attributes object
parseAttributes('.btn #submit disabled type="button"')// → { class: 'btn', id: 'submit', disabled: true, type: 'button' } Copy
parseAttributes('.btn #submit disabled type="button"')// → { class: 'btn', id: 'submit', disabled: true, type: 'button' }
Parses a Pandoc-style attribute string into an object.
Supports the following patterns:
.className→{ class: 'className' }#myId→{ id: 'myId' }key="value"→{ key: 'value' }disabled→{ disabled: true }