on master help sign in
Markdown: fix tabs
f06051bMatilde Park
components/Markdown.js+5−6
@@ -111,14 +111,13 @@ const tab = {
111const tabs = {
111const tabs = {
112 render: "Tabs",
112 render: "Tabs",
113 attributes: {},
113 attributes: {},
114− children: [],
115 transform(node, config) {
114 transform(node, config) {
116 const labels = node
115 const labels = node
117 .transformChildren(config)
116 .transformChildren(config)
118 .filter((child) => child && child.name === "Tab")
117 .filter((child) => child && child.name === "Tab")
119 .map((tab) => (typeof tab === "object" ? tab.attributes.label : null));
118 .map((tab) => (typeof tab === "object" ? tab.attributes.label : null));
120
119
121− return new Tag(this.render, { labels }, tabs);
120+ return new Tag(this.render, { labels }, node.transformChildren(config));
122 },
121 },
123};
122};
124
123
@@ -132,10 +131,10 @@ export default function Markdown({ post }) {
132 footnoteItem,
131 footnoteItem,
133 footnoteRef,
132 footnoteRef,
134 },
133 },
135− // tags: {
134+ tags: {
136− // tabs,
135+ tabs,
137− // tab,
136+ tab,
138− // },
137+ },
139 });
138 });
140 return Markdoc.renderers.react(content, React, {
139 return Markdoc.renderers.react(content, React, {
141 components: {
140 components: {