/([\w:.-]+)\s*=\s*["'](.*?)["']/g used in decrypting attributes will incorrectly deal with the attributes containing ' character as delimiter.
Test cases:
<element attribute='This is a "double quote" inside single quotes'></element>
<element attribute="This is a 'single quote' inside double quotes"></element>
<element attribute='This is an apostrophe: ''></element>
<element attribute="This is a "double quote" inside double quotes"></element>