Despite looking like HTML-like key-value attributes, these do not actually support a '-' in the key name. The problem is this regex;
/\G\s*(\w+)=(?:(("|')(.*)\3)|([^"'\s\]]+))(?= |\])/iU
The \w+
part is what matches the key's name, and this matches [a-zA-Z0-9_]