Problem/Motivation
When generating the llms.txt file from Drupal menus, parent items configured with the <nolink> route (often used as non-clickable containers for submenus) are currently rendered as Markdown links with an empty URL.
For example, given a menu structure where "Menu Item 1" and "Menu Item 2" are parent containers without links:

Current output: The module renders these items with empty parentheses ():

Expected output: Since these items are structural labels and do not point to any resource, they should be rendered as plain text in the Markdown list to provide a cleaner structure for LLMs, avoiding the syntax of broken or empty links.
## Main Menu
- Menu Item 1
- [Menu Item A](http://example.com)
- Menu Item 2
- [Menu Item B](http://example.com)
- [Menu Item C](http://example.com)
Proposed resolution
Update the menu tree rendering logic to check if a menu link is routed to <nolink>. If so, render the item title as a plain string instead of wrapping it in the []() Markdown link syntax.
| Comment | File | Size | Author |
|---|---|---|---|
| llmstxt-file-nolinks.png | 11.26 KB | albeorte | |
| llmstxt-menu-nolinks.png | 13.95 KB | albeorte |
Issue fork llms_txt-3572524
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
albeorte commentedComment #3
mxr576Thanks for raising this issue. Would you be able to try fixing the problem and also extend the related test with an additional test case?
Comment #4
albeorte commentedI will try to have the MR ready for review in the next few days.
Comment #6
albeorte commentedA merge request has been created and test coverage has been extended with this case.
Ready to check!
Comment #8
mxr576Thanks! Simplifed test coverage and merged it.
Comment #10
mxr576Comment #11
albeorte commented@mxr576, please, since it has been merged.
Can you release the version associated with this change?
Comment #12
mxr576Thanks for raising the question, I have already checked when I merged this fix and this is the only commit since the latest tagged version, I would like to check what is in the pipeline and preferably create a release with at least one more commit.
Comment #13
mxr576https://www.drupal.org/project/llms_txt/releases/1.0.6 released. Thanks for the patience.