'))
- const container = this.parseContent(this.createBlock(parent, 'open'), reader)
- const sourceTabs = container.getBlocks()[0]
- if (!(sourceTabs && sourceTabs.getContext() === 'dlist' && sourceTabs.getItems().length)) return
- const tabs = List.$new(parent, 'ulist')
- tabs.addRole('tabs')
- const panes = {}
- sourceTabs.getItems().forEach(([[title], details]) => {
- const tab = ListItem.$new(tabs)
- tabs.$append(tab)
- const id = generateId(title.getText(), tabsetIdx)
- tab.text = `[[${id}]]${title.text}`
- let blocks = details.getBlocks()
- const numBlocks = blocks.length
- if (numBlocks) {
- if (blocks[0].context === 'open' && numBlocks === 1) blocks = blocks[0].getBlocks()
- panes[id] = blocks.map((block) => (block.parent = parent) && block)
- }
- })
- nodes.push(tabs)
- nodes.push(createHtmlFragment('
'))
- Object.entries(panes).forEach(([id, blocks]) => {
- nodes.push(createHtmlFragment(`
`))
- nodes.push(...blocks)
- nodes.push(createHtmlFragment('
'))
- })
- nodes.push(createHtmlFragment('