(txBody: SafeXmlNode)
| 110 | * Parse a text body (`p:txBody` or `a:txBody`). |
| 111 | */ |
| 112 | export function parseTextBody(txBody: SafeXmlNode): TextBody | undefined { |
| 113 | if (!txBody.exists()) return undefined |
| 114 | |
| 115 | const bodyPr = txBody.child('bodyPr') |
| 116 | const lstStyle = txBody.child('lstStyle') |
| 117 | |
| 118 | const paragraphs: TextParagraph[] = [] |
| 119 | for (const pNode of txBody.children('p')) { |
| 120 | paragraphs.push(parseParagraph(pNode)) |
| 121 | } |
| 122 | |
| 123 | return { |
| 124 | bodyProperties: bodyPr.exists() ? bodyPr : undefined, |
| 125 | listStyle: lstStyle.exists() ? lstStyle : undefined, |
| 126 | paragraphs, |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | /** Fill type local names in priority order. */ |
| 131 | const FILL_TYPES = ['solidFill', 'gradFill', 'blipFill', 'pattFill', 'grpFill', 'noFill'] as const |
no test coverage detected