Skip to content

Conversation

@Janjiran
Copy link
Contributor

@Janjiran Janjiran commented Jan 6, 2026

The custom link handler was ignoring the link text (node.children) and only returning the URL.

I have fixed this by adding a helper to extract the link text and returing the links as [text](url) correctly.

Testing

  • npm run build
  • npx docusaurus serve

Tested on following sites:


Note

Fixes markdown link serialization used by the LLMs export.

  • Adds getNodeText helper to recursively extract link text from nodes
  • Updates remarkStringify.handlers.link in docusaurus-plugin-llms-txt config to output [text](url) using title or extracted text, falling back to raw URL
  • Keeps existing internal URL normalization and skip logic intact

Written by Cursor Bugbot for commit 7afb909. Configure here.

@Janjiran Janjiran added this to the 131st sprint - Web team milestone Jan 6, 2026
@Janjiran Janjiran requested review from B4nan and webrdaniel January 6, 2026 11:08
@Janjiran Janjiran added the t-web Issues with this label are in the ownership of the web team. label Jan 6, 2026
/**
* Helper to extract text from a node recursively.
*/
function getNodeText(node) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find any utils file/folder so I've just placed it here but let me know if there is more appropriate place to put this function in.

@apify-service-account
Copy link

Preview for this PR was built for commit 7afb909 and is ready at https://pr-2160.preview.docs.apify.com!

Copy link
Member

@B4nan B4nan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess its fine to keep the helper in the config, this is not a general purpose utility anyway, its a one shot helper for exactly one place.

@Janjiran Janjiran merged commit 4659f4b into master Jan 6, 2026
14 checks passed
@Janjiran Janjiran deleted the fix/markdown-link-formatting branch January 6, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-web Issues with this label are in the ownership of the web team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants