Commit 4659f4b
authored
fix: Fix markdown url links formatting (#2160)
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:
-
https://localhost:3000/platform/integrations/actors/integration-ready-actors.md
- https://localhost:3000/platform/security.md
- https://localhost:3000/platform/integrations.md
<!-- CURSOR_SUMMARY -->
---
> [!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
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
7afb909. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 8778c89 commit 4659f4b
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
12 | 21 | | |
13 | 22 | | |
14 | 23 | | |
| |||
301 | 310 | | |
302 | 311 | | |
303 | 312 | | |
| 313 | + | |
304 | 314 | | |
| 315 | + | |
| 316 | + | |
305 | 317 | | |
306 | 318 | | |
307 | 319 | | |
| |||
0 commit comments