fix: transclude all subsections for embedded call (closes #963) (#964)
| | |
| | | blockRef = blockRef.slice(1) |
| | | let startIdx = undefined |
| | | let endIdx = undefined |
| | | let headerRegex = /h[1-6]/ |
| | | for (const [i, el] of page.htmlAst.children.entries()) { |
| | | if (el.type === "element" && el.tagName.match(/h[1-6]/)) { |
| | | if (el.type === "element" && el.tagName.match(headerRegex)) { |
| | | if (endIdx) { |
| | | break |
| | | } |
| | |
| | | endIdx = i |
| | | } else if (el.properties?.id === blockRef) { |
| | | startIdx = i |
| | | headerRegex = new RegExp(`h[1-${el.tagName.slice(-1)}]`) |
| | | } |
| | | } |
| | | } |