We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3a353ab commit e2ae0baCopy full SHA for e2ae0ba
src/lib/extractAttributes.ts
@@ -2,7 +2,7 @@ import { AttributeNode, TextNode } from '../print/nodes';
2
3
export function extractAttributes(html: string): AttributeNode[] {
4
const extractAttributesRegex = /<[a-z]+[\s\n]*([\s\S]*?)>/im;
5
- const attributeRegex = /([^\s=]+)(?:=("|')([\s\S]*?)\2)?/gim;
+ const attributeRegex = /([^\s=]+)(?:=("|'|)([\s\S]*?)\2)?(?: |$)/gim;
6
7
const [, attributesString] = html.match(extractAttributesRegex)!;
8
0 commit comments