* 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, )
| 863 | * @param doc The document |
| 864 | */ |
| 865 | function insertCorruptedTextNodeMarkers( |
| 866 | corruptedTextNodes: Map<HTMLElement, string>, |
| 867 | doc: Document, |
| 868 | ) { |
| 869 | for (const [textNode, marker] of corruptedTextNodes) { |
| 870 | textNode.after(doc.createComment(marker)); |
| 871 | } |
| 872 | } |
| 873 | |
| 874 | /** |
| 875 | * Detects whether a given TNode represents a node that |
no test coverage detected
searching dependent graphs…