llms.txt exports drop `import` lines and JSX-like code from code examples

Open Beginner friendly
#2,561 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@RaphaelFakhri is already working on this.

Since Nov 3, 2026.

  • #2562 by @RaphaelFakhri — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Domain
documentation

Research direction

Start with stripMdxSyntax() in src/utils/llms.ts and reproduce the issue using /llms/api-5x.txt and the linked performance best practices example. Check how the import and JSX-like text in fenced code blocks are handled. Done means code examples retain that content in the plain-text exports.

Written by the indexing model from the issue text.

Description

The plain-text exports under /llms/ remove content from fenced code blocks. stripMdxSyntax() in src/utils/llms.ts strips every line that starts with import and every <Capitalized ...> tag in the file, including lines inside code examples.

Steps to reproduce

  1. Open https://expressjs.com/llms/api-5x.txt.
  2. Find the first ```mjs title="index.mjs" block.

Expected behavior

The example starts with import express from 'express';, as on the HTML page.

Actual behavior

The import line is replaced by an empty line, so the ESM examples reference express without importing it. The same applies to every ESM example in the API and guide exports. Code that looks like a JSX tag is also removed, for example Description=<Awesome Express App> in the systemd unit on the performance best practices page becomes Description=.

Dominant language
MDX
Stars
5.4k
Forks
2.3k
Avg merge
2d 23h
Merged PRs (30d)
28

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from expressjs/expressjs.com

All issues in expressjs/expressjs.com

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.