diff --git a/src/index.ts b/src/index.ts index 9e60796..99fb493 100644 --- a/src/index.ts +++ b/src/index.ts @@ -44,7 +44,7 @@ const parser = (html: string, options: Options = {}): Node[] => { Object.keys(attrs).forEach((key: string) => { const object: Attributes = {}; - object[key] = attrs[key].replace(/"/g, '"'); + object[key] = String(attrs[key]).replace(/"/g, '"'); Object.assign(result, object); });