* Parse a raw XML child node from a group's spTree into a typed node object. * Returns undefined for unrecognized or unsupported elements.
(childXml: SafeXmlNode, ctx: RenderContext)
| 189 | * Returns undefined for unrecognized or unsupported elements. |
| 190 | */ |
| 191 | function parseGroupChild(childXml: SafeXmlNode, ctx: RenderContext): BaseNodeData | undefined { |
| 192 | const tag = childXml.localName |
| 193 | |
| 194 | switch (tag) { |
| 195 | case 'sp': |
| 196 | case 'cxnSp': |
| 197 | return parseShapeNode(childXml) |
| 198 | case 'pic': |
| 199 | return parsePicNode(childXml) |
| 200 | case 'grpSp': |
| 201 | return parseGroupNode(childXml) |
| 202 | case 'graphicFrame': { |
| 203 | const graphic = childXml.child('graphic') |
| 204 | const graphicData = graphic.child('graphicData') |
| 205 | if (graphicData.child('tbl').exists()) { |
| 206 | return parseTableNode(childXml) |
| 207 | } |
| 208 | if ((graphicData.attr('uri') || '').includes('chart')) { |
| 209 | return parseChartNode(childXml, ctx.slide.rels, ctx.slide.slidePath) |
| 210 | } |
| 211 | const olePic = parseOleFrameAsPicture(childXml) |
| 212 | if (olePic) return olePic |
| 213 | return undefined |
| 214 | } |
| 215 | default: |
| 216 | return undefined |
| 217 | } |
| 218 | } |
no test coverage detected