'));
51 | const container = this.parseContent(
52 | this.createBlock(parent, "open"),
53 | reader
54 | );
55 | const sourceTabs = container.getBlocks()[0];
56 | if (
57 | !(
58 | sourceTabs &&
59 | sourceTabs.getContext() === "dlist" &&
60 | sourceTabs.getItems().length
61 | )
62 | )
63 | return;
64 | const tabs = List.$new(parent, "ulist");
65 | tabs.addRole("tabs");
66 | const panes = {};
67 | sourceTabs.getItems().forEach(([[title], details]) => {
68 | const tab = ListItem.$new(tabs);
69 | tabs.$append(tab);
70 | const id = generateId(title.getText(), tabsetIdx);
71 | tab.text = `[[${id}]]${title.text}`;
72 | let blocks = details.getBlocks();
73 | const numBlocks = blocks.length;
74 | if (numBlocks) {
75 | if (blocks[0].context === "open" && numBlocks === 1)
76 | blocks = blocks[0].getBlocks();
77 | panes[id] = blocks.map(block => (block.parent = parent) && block);
78 | }
79 | });
80 | nodes.push(tabs);
81 | nodes.push(createHtmlFragment('
'));
82 | Object.entries(panes).forEach(([id, blocks]) => {
83 | nodes.push(
84 | createHtmlFragment(`
`)
85 | );
86 | nodes.push(...blocks);
87 | nodes.push(createHtmlFragment("
"));
88 | });
89 | nodes.push(createHtmlFragment("