Skip to content

Libdoc: Local Markdown reference targets cannot be used in argument, return or exception documentation #5810

Closed

Description

@pekkaklarck

For example, if you have a library with the following Markdown documentation, all other reference link usages except [local] in the argument documentation work. A concrete example is BuiltIn.Log To Console. It has a working link to format specification in the overall keyword docs, but the same link doesn't work with the format argument.

"""Intro with a [global] reference.

[global]: http://example.com
"""

def kw(arg):
    """Keyword with [global] and [local] references.

    Args:
        arg: Argument with [global] and [local] references.

    [local]: http://robotframework.org
    """

The overall design with references is this:

  • Global references created in the introduction work everywhere.
  • Local references created inside a keyword doc work with that keyword but not with other keywords.

The reason local references don't work with arguments or with return values or exceptions is that they are converted to HTML as a separate step and references created when the overall keyword doc was created are cleared before that. This can be fixed relatively easily by not clearing everything every time and instead adding a separate clear() or reset() method for clearing the state when appropriate.

This bug can also be worked around by using global reference targets when references are needed with arguments. It's better to fix the underlying bug, but the pretty simple workaround means this issue doesn't deserve high priority.

Activity

  1. added this to the v7.5.1 milestone on Oct 6, 2026
  2. self-assigned this
    on Oct 6, 2026
  3. added theissue type on Oct 6, 2026
  4. added a commit that references this issue on Oct 7, 2026
    fe64590
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions