Skip to content

When relativePath: true, even absolute paths are for icons in sidebar are resolved as relative. #877

Closed
@filipgoc

Description

@filipgoc

Bug Report

When relativePath: true, absolute paths are for icons in sidebar are resolved as relative.

Steps to reproduce

Set relativePath: true

└── docs
    ├── _sidebar.md
    ├── guide.md
    └── subfolder
        ├── _sidebar.md
        ├── guide.md

In the both _sidebar files, I have - [![](/assets/home.svg)Home](/ "Home")

What is current behaviour

While the link gets resolved as absolute (👍 ),
for images,
the data-origin is correct (👍 ), but the img scr is relative and thus failing (👎 )

<a href="#/" title="Home"><img src="/subfolder/assets/home.svg" data-origin="/assets/home.svg" alt="">Home</a>

What is the expected behaviour

The img src should be absolute:
"/assets/home.svg"

Other relevant information

  • Bug does still occur when all/other plugins are disabled?

  • Your OS:

  • Node.js version:

  • npm/yarn version:

  • Browser version:

  • Docsify version: 4.9.4

  • Docsify plugins: pagination, themeable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions