rme 0.3.0-beta.33 → 0.3.0-beta.34

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.mjs CHANGED
@@ -2517,10 +2517,17 @@ var rule = (state) => {
2517
2517
  const match = /^\[([ |x])\]\s?/.exec(inlineToken.content);
2518
2518
  if (match) {
2519
2519
  const checked = match[1] === "x";
2520
- inlineToken.content = inlineToken.content.slice(match[0].length);
2521
- inlineToken.children?.forEach((child) => {
2522
- child.content = inlineToken.content;
2523
- });
2520
+ const checkboxPrefix = match[0];
2521
+ inlineToken.content = inlineToken.content.slice(checkboxPrefix.length);
2522
+ if (inlineToken.children && inlineToken.children.length > 0) {
2523
+ const firstTextChild = inlineToken.children.find((child) => child.type === "text");
2524
+ if (firstTextChild) {
2525
+ const originalContent = firstTextChild.content;
2526
+ if (originalContent.startsWith(checkboxPrefix)) {
2527
+ firstTextChild.content = originalContent.slice(checkboxPrefix.length);
2528
+ }
2529
+ }
2530
+ }
2524
2531
  const checkboxToken = new Token("list_checkbox", "input", 0);
2525
2532
  checkboxToken.attrPush(["type", "checkbox"]);
2526
2533
  if (checked) {
@@ -9668,7 +9675,6 @@ var LineListExtension = class extends NodeExtension8 {
9668
9675
  switch (state.topContext()) {
9669
9676
  case "ordered_list":
9670
9677
  const token2 = state.topContextToken();
9671
- state.closeContext;
9672
9678
  let startOrder;
9673
9679
  if (token2?.type === "ordered_list_open") {
9674
9680
  token2?.attrs?.some(([name, value]) => {
@@ -9738,7 +9744,7 @@ var LineListExtension = class extends NodeExtension8 {
9738
9744
  firstDelim = "- ";
9739
9745
  }
9740
9746
  state.wrapBlock(
9741
- " ".repeat(firstDelim.length),
9747
+ " ",
9742
9748
  firstDelim,
9743
9749
  node,
9744
9750
  () => state.renderContent(node)