* Build a cache key for a color node based on its tag, value, and modifiers.
(colorNode: SafeXmlNode)
| 17 | * Build a cache key for a color node based on its tag, value, and modifiers. |
| 18 | */ |
| 19 | function buildColorCacheKey(colorNode: SafeXmlNode): string { |
| 20 | const parts: string[] = [colorNode.localName, colorNode.attr('val') ?? ''] |
| 21 | for (const child of colorNode.allChildren()) { |
| 22 | const tag = child.localName |
| 23 | const val = child.attr('val') |
| 24 | if (tag) parts.push(`${tag}:${val ?? ''}`) |
| 25 | // Include nested color children for wrapper nodes |
| 26 | for (const grandchild of child.allChildren()) { |
| 27 | const gtag = grandchild.localName |
| 28 | const gval = grandchild.attr('val') |
| 29 | if (gtag) parts.push(`${gtag}:${gval ?? ''}`) |
| 30 | } |
| 31 | } |
| 32 | return parts.join('|') |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Collect OOXML color modifier children from a color node. |
no test coverage detected