{
  "doc": {
    "id": "api/commands/closest",
    "title": "cy.closest()",
    "description": "Get the first DOM element that matches the selector in Cypress (whether it be itself or one of its ancestors).",
    "section": "api",
    "source_path": "/llm/markdown/api/commands/closest.md",
    "version": "f97f06d85653c51afe39a9bd3cefda946807f150",
    "updated_at": "2026-10-05T21:01:45.863Z",
    "headings": [
      {
        "id": "api/commands/closest#closest",
        "text": "closest",
        "level": 1
      },
      {
        "id": "api/commands/closest#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/commands/closest#usage",
        "text": "Usage",
        "level": 3
      },
      {
        "id": "api/commands/closest#arguments",
        "text": "Arguments",
        "level": 3
      },
      {
        "id": "api/commands/closest#yields",
        "text": "Yields",
        "level": 3
      },
      {
        "id": "api/commands/closest#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/commands/closest#selector",
        "text": "Selector",
        "level": 3
      },
      {
        "id": "api/commands/closest#find-the-closest-ancestor-of-p-error-with-class-banner",
        "text": "Find the closest ancestor of p.error with class banner",
        "level": 4
      },
      {
        "id": "api/commands/closest#yield-the-subject-itself-when-it-matches",
        "text": "Yield the subject itself when it matches",
        "level": 4
      },
      {
        "id": "api/commands/closest#act-on-one-card-in-a-repeated-list",
        "text": "Act on one card in a repeated list",
        "level": 4
      },
      {
        "id": "api/commands/closest#assert-on-a-form-fields-wrapper",
        "text": "Assert on a form field's wrapper",
        "level": 4
      },
      {
        "id": "api/commands/closest#compare-closest-with-parents",
        "text": "Compare .closest() with .parents()",
        "level": 4
      },
      {
        "id": "api/commands/closest#assert-that-an-element-is-not-inside-a-container",
        "text": "Assert that an element is not inside a container",
        "level": 4
      },
      {
        "id": "api/commands/closest#notes",
        "text": "Notes",
        "level": 2
      },
      {
        "id": "api/commands/closest#shadow-dom-boundaries-and-closest",
        "text": "Shadow DOM boundaries and .closest()",
        "level": 3
      },
      {
        "id": "api/commands/closest#rules",
        "text": "Rules",
        "level": 2
      },
      {
        "id": "api/commands/closest#requirements",
        "text": "Requirements",
        "level": 3
      },
      {
        "id": "api/commands/closest#assertions",
        "text": "Assertions",
        "level": 3
      },
      {
        "id": "api/commands/closest#timeouts",
        "text": "Timeouts",
        "level": 3
      },
      {
        "id": "api/commands/closest#command-log",
        "text": "Command Log",
        "level": 2
      },
      {
        "id": "api/commands/closest#history",
        "text": "History",
        "level": 2
      },
      {
        "id": "api/commands/closest#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "content": {
    "type": "root",
    "children": [
      {
        "type": "heading",
        "depth": 1,
        "children": [
          {
            "type": "text",
            "value": "closest"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Get the first DOM element that matches the selector (whether it be itself or one of its ancestors)."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "`.closest()` tests the element itself first, then travels up the DOM tree through its ancestors."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "The querying behavior of this command matches how "
          },
          {
            "type": "link",
            "title": null,
            "url": "https://api.jquery.com/closest",
            "children": [
              {
                "type": "text",
                "value": "`.closest()`"
              }
            ]
          },
          {
            "type": "text",
            "value": " works in jQuery, except that Cypress continues past shadow DOM boundaries. See "
          },
          {
            "type": "link",
            "title": null,
            "url": "#Shadow-DOM-boundaries-and-closest",
            "children": [
              {
                "type": "text",
                "value": "Shadow DOM boundaries and `.closest()`"
              }
            ]
          },
          {
            "type": "text",
            "value": "."
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Syntax"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": ".closest(selector)\n.closest(selector, options)"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Usage"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Correct Usage"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('td').closest('.filled') // Yield closest el with class 'filled'"
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Incorrect Usage"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.closest('.active') // Errors, cannot be chained off 'cy'\ncy.clock().closest() // Errors, 'clock' does not yield DOM elements"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Arguments"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "selector (String selector)"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "A selector the element itself or one of its ancestors must match."
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "options (Object)"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Pass in an options object to change the default behavior of `.closest()`."
          }
        ]
      },
      {
        "type": "table",
        "align": [
          null,
          null,
          null
        ],
        "children": [
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Option"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Default"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Description"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`log`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`true`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Displays the command in the "
                  },
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/core-concepts/open-mode.md#Command-Log",
                    "children": [
                      {
                        "type": "text",
                        "value": "Command log"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`timeout`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/references/configuration.md#Timeouts",
                    "children": [
                      {
                        "type": "text",
                        "value": "`defaultCommandTimeout`"
                      }
                    ]
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Time to wait for `.closest()` to resolve before "
                  },
                  {
                    "type": "link",
                    "title": null,
                    "url": "#Timeouts",
                    "children": [
                      {
                        "type": "text",
                        "value": "timing out"
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Yields"
          }
        ]
      },
      {
        "type": "list",
        "ordered": false,
        "start": null,
        "spread": false,
        "children": [
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "`.closest()` yields the new DOM element(s) it found. When the subject holds more than one element, it yields the closest match for each one, with duplicates removed."
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "`.closest()` is a query, and it is safe to chain further commands."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Examples"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Selector"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Find the closest ancestor of `p.error` with class `banner`"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "<div class=\"banner\">\n  <div class=\"content\">\n    <p class=\"error\">Payment failed</p>\n  </div>\n</div>"
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "// yields <div class=\"banner\">…</div>\ncy.get('p.error').closest('.banner')"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Yield the subject itself when it matches"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "<ul class=\"nav\">\n  <li class=\"active\">Home</li>\n</ul>"
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "// yields <li class=\"active\">Home</li>, since the subject\n// matches the selector before any ancestor is tested\ncy.get('li.active').closest('li')"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Act on one card in a repeated list"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Find something unique inside a repeated component, climb to the component with `.closest()`, then query inside it."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "<div data-cy=\"product-card\">\n  <h3>Trail Runner</h3>\n  <button>Add to cart</button>\n</div>\n<div data-cy=\"product-card\">\n  <h3>Road Racer</h3>\n  <button>Add to cart</button>\n</div>"
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "// clicks the \"Add to cart\" button in the Road Racer card only\ncy.contains('h3', 'Road Racer')\n  .closest('[data-cy=\"product-card\"]')\n  .find('button')\n  .click()"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Assert on a form field's wrapper"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Validation state often lives on a wrapper element rather than on the input."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "<div class=\"form-group has-error\">\n  <label for=\"email\">Email</label>\n  <input id=\"email\" type=\"email\" />\n</div>"
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('#email').closest('.form-group').should('have.class', 'has-error')"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Compare `.closest()` with `.parents()`"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "`.closest()` stops at the first match. "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/api/commands/parents.md",
            "children": [
              {
                "type": "text",
                "value": "`.parents()`"
              }
            ]
          },
          {
            "type": "text",
            "value": " collects every matching ancestor."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "<section class=\"panel outer\">\n  <section class=\"panel inner\">\n    <button>Save</button>\n  </section>\n</section>"
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "// yields <section class=\"panel inner\">\ncy.get('button').closest('.panel')\n\n// yields <section class=\"panel inner\"> and <section class=\"panel outer\">\ncy.get('button').parents('.panel')"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Assert that an element is not inside a container"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "When no ancestor matches, `.closest()` yields an empty result, so `.should('not.exist')` passes."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "// passes when the checkout button is not inside a modal\ncy.get('[data-cy=\"checkout\"]').closest('.modal').should('not.exist')"
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Notes"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Shadow DOM boundaries and `.closest()`"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "When the subject is inside a shadow root, `.closest()` crosses the shadow boundary. If nothing inside the shadow root matches, it continues from the shadow host, testing the host itself and then the host's ancestors, until it finds a match or reaches the document. This happens whether or not "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/app/references/configuration.md#Global",
            "children": [
              {
                "type": "text",
                "value": "`includeShadowDom`"
              }
            ]
          },
          {
            "type": "text",
            "value": " is enabled. The option controls whether queries like "
          },
          {
            "type": "link",
            "title": null,
            "url": "/llm/markdown/api/commands/find.md",
            "children": [
              {
                "type": "text",
                "value": "`.find()`"
              }
            ]
          },
          {
            "type": "text",
            "value": " reach into a shadow root, not whether `.closest()` climbs back out of one."
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "<form id=\"checkout\">\n  <payment-panel>\n    <template shadowrootmode=\"open\">\n      <button>Pay now</button>\n    </template>\n  </payment-panel>\n</form>"
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "// .find() needs includeShadowDom to reach the button;\n// .closest() crosses back out of the shadow root on its own\n// yields <form id=\"checkout\">\ncy.get('payment-panel')\n  .find('button', { includeShadowDom: true })\n  .closest('form')"
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Rules"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Requirements"
          }
        ]
      },
      {
        "type": "list",
        "ordered": false,
        "start": null,
        "spread": false,
        "children": [
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "`.closest()` requires being chained off a command that yields DOM element(s) or a document."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Assertions"
          }
        ]
      },
      {
        "type": "list",
        "ordered": false,
        "start": null,
        "spread": false,
        "children": [
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "`.closest()` will automatically "
                  },
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/core-concepts/retry-ability.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "retry"
                      }
                    ]
                  },
                  {
                    "type": "text",
                    "value": " until the element(s) "
                  },
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/core-concepts/introduction-to-cypress.md#Implicit-Assertions",
                    "children": [
                      {
                        "type": "text",
                        "value": "exist in the DOM"
                      }
                    ]
                  },
                  {
                    "type": "text",
                    "value": "."
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "`.closest()` will automatically "
                  },
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/core-concepts/retry-ability.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "retry"
                      }
                    ]
                  },
                  {
                    "type": "text",
                    "value": " until all chained assertions have passed."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Timeouts"
          }
        ]
      },
      {
        "type": "list",
        "ordered": false,
        "start": null,
        "spread": false,
        "children": [
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "`.closest()` can time out waiting for the element(s) to "
                  },
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/core-concepts/introduction-to-cypress.md#Implicit-Assertions",
                    "children": [
                      {
                        "type": "text",
                        "value": "exist in the DOM"
                      }
                    ]
                  },
                  {
                    "type": "text",
                    "value": "."
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "`.closest()` can time out waiting for assertions you've added to pass."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Command Log"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "Find the closest element of `li.active` with the class 'nav'"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "cy.get('li.active').closest('.nav')"
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "The commands above will display in the Command Log as:"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "When clicking on the `closest` command within the command log, the console outputs the following:"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "History"
          }
        ]
      },
      {
        "type": "table",
        "align": [
          null,
          null
        ],
        "children": [
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Version"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Changes"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/references/changelog.md#12-6-0",
                    "children": [
                      {
                        "type": "text",
                        "value": "12.6.0"
                      }
                    ]
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Overwrite `.closest()` with "
                  },
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/api/cypress-api/custom-queries.md#Overwriting-Existing-Queries",
                    "children": [
                      {
                        "type": "text",
                        "value": "`Cypress.Commands.overwriteQuery()`"
                      }
                    ]
                  },
                  {
                    "type": "text",
                    "value": " rather than `Cypress.Commands.overwrite()`."
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/app/references/changelog.md#12-0-0",
                    "children": [
                      {
                        "type": "text",
                        "value": "12.0.0"
                      }
                    ]
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`.closest()` is now a query."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "See also"
          }
        ]
      },
      {
        "type": "list",
        "ordered": false,
        "start": null,
        "spread": false,
        "children": [
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/api/commands/first.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "`.first()`"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/api/commands/parent.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "`.parent()`"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/api/commands/parents.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "`.parents()`"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/api/commands/parentsuntil.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "`.parentsUntil()`"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/api/commands/prev.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "`.prev()`"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/api/commands/prevall.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "`.prevAll()`"
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "link",
                    "title": null,
                    "url": "/llm/markdown/api/commands/prevuntil.md",
                    "children": [
                      {
                        "type": "text",
                        "value": "`.prevUntil()`"
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  },
  "token_estimate": 1007
}