Skip to content

Commit

Permalink
patch: fix to drop C elements
Browse files Browse the repository at this point in the history
  • Loading branch information
LumaKernel committed Feb 4, 2024
1 parent c698eea commit 6457e85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
17 changes: 1 addition & 16 deletions examples/render/output/counter.mdx.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ function _createMdxContent(props) {
p: "p",
...props.components,
},
{ C, LumaCounter, LumaMdxLayout, LumaToc } = _components;
if (!C) _missingMdxReference("C", true);
{ LumaCounter, LumaMdxLayout, LumaToc } = _components;
if (!LumaCounter) _missingMdxReference("LumaCounter", true);
if (!LumaMdxLayout) _missingMdxReference("LumaMdxLayout", true);
if (!LumaToc) _missingMdxReference("LumaToc", true);
Expand Down Expand Up @@ -66,10 +65,6 @@ function _createMdxContent(props) {
}),
void (globalThis[_rehypeKatexContext0] = ""),
"\n",
_jsx(C, {
$foo: true,
template: "%1(/%n): ",
}),
"\n",
_jsxs(_components.h1, {
slug: "用意する",
Expand Down Expand Up @@ -120,9 +115,6 @@ function _createMdxContent(props) {
],
}),
"\n",
_jsx(C, {
template: "%0.",
}),
"\n",
_jsxs(_components.p, {
children: [
Expand All @@ -147,10 +139,6 @@ function _createMdxContent(props) {
],
}),
"\n",
_jsx(C, {
template: "[重要] %0.",
keep: true,
}),
"\n",
_jsxs(_components.p, {
children: [
Expand All @@ -171,9 +159,6 @@ function _createMdxContent(props) {
],
}),
"\n",
_jsx(C, {
template: "%0.",
}),
"\n",
_jsx(_components.p, {
children: "片付け編:",
Expand Down
3 changes: 2 additions & 1 deletion src/rehype-counter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MdxJsxFlowElementHast } from "mdast-util-mdx-jsx";
import { visit } from "./util/visit.js";
import { DELETE, visit } from "./util/visit.js";
import { getAttrByName } from "./util/util-mdast.js";
import { estreeJsonParseOf } from "./util/estree-json-parse-of.js";
import { lumaCounter } from "./luma-counter/micromark-extension.js";
Expand Down Expand Up @@ -70,6 +70,7 @@ const rehypeCounter: RehypeCounterPlugin = function () {
resetCounter(name);
count.set(name, 0);
}
return DELETE;
} else if (
node.type === "mdxJsxFlowElement" &&
node.name === "_luma_internal_counter"
Expand Down

0 comments on commit 6457e85

Please sign in to comment.