Skip to content

Inclusion of files with :relative-images:/:relative-docs: doesn't seem to work on links to images #1041

@Metadorius

Description

@Metadorius

What version of myst-parser are you using?

4.0.0

What version dependencies are you using?

requirements.txt:

myst-parser==4.0.0
Sphinx==7.4.7
sphinx-rtd-theme==2.0.0
sphinx-design==0.6.1

.readthedocs.yaml:

# Set the version of Python and other tools you might need
build:
   os: ubuntu-24.04
   tools:
      python: "3.11"

What operating system are you using?

Linux

Describe the Bug

When including .md files from other directories, like README.md from the repo root, :relative-images:/:relative-docs: doesn't seem to work on links to images.

This is at the bottom my index.md:

```{include} ../README.md
:relative-docs: docs/
:relative-images:
```

Expected Behavior

The image should be linked properly.

To Reproduce

Phobos-developers/Phobos#1765 (comment)

Just link the image relatively to the included file like [link](path/to/image.png), not ![description](path/to/image.png).

The result:

https://phobos--1765.org.readthedocs.build/en/1765/#:~:text=%40TaranDahl%20(%E8%88%AA%E5%91%B3%E9%BA%BB%E9%85%B1)%20%2D%20T1%20maintainer

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions