Skip to content

Commit

Permalink
capricorn86#335@patch: Fix escaping attribute value.
Browse files Browse the repository at this point in the history
  • Loading branch information
Demivan committed Jan 20, 2022
1 parent 68c084f commit 8f61417
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/happy-dom/src/xml-serializer/XMLSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Node from '../nodes/node/Node';
import SelfClosingElements from '../config/SelfClosingElements';
import UnclosedElements from '../config/UnclosedElements';
import DocumentType from '../nodes/document-type/DocumentType';
import { encode } from 'he';
import { escape } from 'he';
import INode from '../nodes/node/INode';
import IElement from '../nodes/element/IElement';

Expand Down Expand Up @@ -70,7 +70,7 @@ export default class XMLSerializer {
let attributeString = '';
for (const attribute of Object.values((<Element>element)._attributes)) {
if (attribute.value !== null) {
attributeString += ' ' + attribute.name + '="' + encode(attribute.value) + '"';
attributeString += ' ' + attribute.name + '="' + escape(attribute.value) + '"';
}
}
return attributeString;
Expand Down

0 comments on commit 8f61417

Please sign in to comment.