MCPcopy Index your code
hub / github.com/simstudioai/sim / findStyleAtLevel

Function findStyleAtLevel

apps/sim/lib/pptx-renderer/renderer/text-renderer.ts:23–32  ·  view source on GitHub ↗

* Find paragraph properties at a specific indent level from a list style node. * Tries lvl{n}pPr (where n = level + 1), then falls back to defPPr.

(styleNode: SafeXmlNode | undefined, level: number)

Source from the content-addressed store, hash-verified

21 * Tries lvl{n}pPr (where n = level + 1), then falls back to defPPr.
22 */
23function findStyleAtLevel(styleNode: SafeXmlNode | undefined, level: number): SafeXmlNode {
24 if (!styleNode || !styleNode.exists()) {
25 return new SafeXmlNode(null)
26 }
27 // Try level-specific style (lvl1pPr, lvl2pPr, etc.)
28 const lvlNode = styleNode.child(`lvl${level + 1}pPr`)
29 if (lvlNode.exists()) return lvlNode
30 // Fall back to default
31 return styleNode.child('defPPr')
32}
33
34/**
35 * Determine the placeholder category for style inheritance.

Callers 1

renderTextBodyFunction · 0.85

Calls 2

existsMethod · 0.80
childMethod · 0.80

Tested by

no test coverage detected