* Physically inserts the comment nodes to ensure empty text nodes and adjacent * text node separators are preserved after server serialization of the DOM. * These get swapped back for empty text nodes or separators once hydration happens * on the client. * * @param corruptedTextNodes The Map of
( corruptedTextNodes: Map<HTMLElement, string>, doc: Document, )
| 862 | * @param doc The document |
| 863 | */ |
| 864 | function insertCorruptedTextNodeMarkers( |
| 865 | corruptedTextNodes: Map<HTMLElement, string>, |
| 866 | doc: Document, |
| 867 | ) { |
| 868 | for (const [textNode, marker] of corruptedTextNodes) { |
| 869 | textNode.after(doc.createComment(marker)); |
| 870 | } |
| 871 | } |
| 872 | |
| 873 | /** |
| 874 | * Detects whether a given TNode represents a node that |
no test coverage detected