Skip to content

Relative links to images via <picture> <source srcset> do not work #2975

@laymonage

Description

@laymonage

Search terms

Relative links images picture tag srcset attribute broken

Expected Behavior

Given the following HTML in a Markdown document (as per GitHub's recommendation):

    <picture>
        <source media="(prefers-color-scheme: light)" srcset=".github/wagtail.svg">
        <source media="(prefers-color-scheme: dark)" srcset=".github/wagtail-inverse.svg">
        <img width="343" src=".github/wagtail.svg" alt="Wagtail">
    </picture>

Typedoc should copy both wagtail.svg and wagtail-inverse.svg to the media directory and render the HTML as:

    <picture>
        <source media="(prefers-color-scheme: light)" srcset="media/wagtail.svg">
        <source media="(prefers-color-scheme: dark)" srcset="media/wagtail-inverse.svg">
        <img width="343" src="media/wagtail.svg" alt="Wagtail">
    </picture>

Actual Behavior

Typedoc only copies wagtail.svg and renders the HTML like the following:

    <picture>
        <source media="(prefers-color-scheme: light)" srcset=".github/wagtail.svg">
        <source media="(prefers-color-scheme: dark)" srcset=".github/wagtail-inverse.svg">
        <img width="343" src="media/wagtail.svg" alt="Wagtail">
    </picture>

Steps to reproduce the bug

Environment

  • Typedoc version: 0.28.7
  • TypeScript version: 5.6.3
  • Node.js version: 22.11.0
  • OS: macOS Sequoia 15.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions