(
node: Node | null,
open = '[',
close = ']',
)
| 746 | |
| 747 | // looks ahead for a start and closing comment node |
| 748 | const locateClosingAnchor = ( |
| 749 | node: Node | null, |
| 750 | open = '[', |
| 751 | close = ']', |
| 752 | ): Node | null => { |
| 753 | let match = 0 |
| 754 | while (node) { |
| 755 | node = nextSibling(node) |
| 756 | if (node && isComment(node)) { |
| 757 | if (node.data === open) match++ |
| 758 | if (node.data === close) { |
| 759 | if (match === 0) { |
| 760 | return nextSibling(node) |
| 761 | } else { |
| 762 | match-- |
| 763 | } |
| 764 | } |
| 765 | } |
| 766 | } |
| 767 | return node |
| 768 | } |
| 769 | |
| 770 | const replaceNode = ( |
| 771 | newNode: Node, |
no test coverage detected