Closed fish0710 closed 2 months ago
This pull request addresses two issues in the HTML replacer functionality: handling of elements without attributes and filtering out carriage return characters in attribute names. The changes are implemented in the createHTMLReplacer
function within the src/replacer/html.ts
file.
Files | Changes |
---|---|
src/replacer/html.ts |
Added a null check using the optional chaining operator (?.) before calling forEach on astNode.content.attributes to prevent errors when an element has no attributes. |
src/replacer/html.ts |
Implemented a filter to skip processing of attributes with a key content of '\r' (carriage return) to avoid issues with newline characters in attribute names. |
Summary by Sourcery
Fix errors in the HTML replacer when elements have no attributes and enhance the replacer to ignore carriage return characters in attribute keys.
Bug Fixes:
Enhancements: