@umbraco-cms/backoffice
    Preparing search index...

    Function parseAttributes

    • Parses a Pandoc-style attribute string into an object.

      Supports the following patterns:

      • Classes: .className{ class: 'className' }
      • IDs: #myId{ id: 'myId' }
      • Key-value pairs: key="value"{ key: 'value' }
      • Boolean attributes: disabled{ disabled: true }

      Parameters

      • attrString: string

        The attribute string to parse

      Returns Record<string, any>

      Parsed attributes object

      parseAttributes('.btn #submit disabled type="button"')
      // → { class: 'btn', id: 'submit', disabled: true, type: 'button' }