@hyperbook/markdown 0.17.1 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -8
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -63162,7 +63162,15 @@ var remarkDirectiveTabs_default = (ctx) => () => {
|
|
|
63162
63162
|
let first = true;
|
|
63163
63163
|
node3.children.filter(isDirective).forEach((node4) => {
|
|
63164
63164
|
expectContainerDirective(node4, file, "tab");
|
|
63165
|
-
let { title, id: tabId = hash(node4) } = node4.attributes || {};
|
|
63165
|
+
let { title = "", id: tabId = hash(node4) } = node4.attributes || {};
|
|
63166
|
+
let tree2 = remark(ctx).parse(title);
|
|
63167
|
+
remarkGemoji()(tree2);
|
|
63168
|
+
let hastTree = toHast(tree2);
|
|
63169
|
+
if (hastTree.type === "root" && hastTree.children[0]?.type === "element" && hastTree.children[0]?.tagName === "p") {
|
|
63170
|
+
hastTree = hastTree.children[0];
|
|
63171
|
+
hastTree.tagName = "span";
|
|
63172
|
+
}
|
|
63173
|
+
console.log(JSON.stringify(hastTree, null, 2));
|
|
63166
63174
|
tabTitleElements.push({
|
|
63167
63175
|
type: "element",
|
|
63168
63176
|
tagName: "button",
|
|
@@ -63171,12 +63179,7 @@ var remarkDirectiveTabs_default = (ctx) => () => {
|
|
|
63171
63179
|
"data-tabs-id": tabsId,
|
|
63172
63180
|
class: "tab" + (first ? " active" : "")
|
|
63173
63181
|
},
|
|
63174
|
-
children: [
|
|
63175
|
-
{
|
|
63176
|
-
type: "text",
|
|
63177
|
-
value: title || ""
|
|
63178
|
-
}
|
|
63179
|
-
]
|
|
63182
|
+
children: hastTree.children || []
|
|
63180
63183
|
});
|
|
63181
63184
|
tabContentElements.push({
|
|
63182
63185
|
type: "element",
|
|
@@ -72464,6 +72467,7 @@ var remarkDirectiveGeogebra_default = (ctx) => () => {
|
|
|
72464
72467
|
var remark = (ctx) => {
|
|
72465
72468
|
const remarkPlugins = [
|
|
72466
72469
|
remarkRemoveComments,
|
|
72470
|
+
remarkGemoji,
|
|
72467
72471
|
remarkDirective,
|
|
72468
72472
|
dist_default,
|
|
72469
72473
|
remarkDirectivePagelist_default(ctx),
|
|
@@ -72495,7 +72499,6 @@ var remark = (ctx) => {
|
|
|
72495
72499
|
remarkDirectiveGeogebra_default(ctx),
|
|
72496
72500
|
remarkCode_default(ctx),
|
|
72497
72501
|
remarkMath,
|
|
72498
|
-
remarkGemoji,
|
|
72499
72502
|
remarkUnwrapImages,
|
|
72500
72503
|
/* needs to be last directive */
|
|
72501
72504
|
remarkDirectiveProtect_default(ctx),
|