@wordpress/e2e-tests
Version:
End-To-End (E2E) tests for WordPress.
18 lines (16 loc) • 541 B
JavaScript
const processingInstructions = `
<div>
<div>Processing instruction is <?xpacket
<?xpacket
<div data-testid="it should keep this node between processing instructions">
Processing instructions inner node
<?xpacket
</div>
</div>
`;
const processingInstructionsElement = new DOMParser()
.parseFromString( processingInstructions, 'text/xml' )
.querySelector( 'div' );
document
.getElementById( 'replace-with-processing-instructions' )
.replaceWith( processingInstructionsElement );