Skip to content

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

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 (👎 )

<ahref="#/" title="Home"><imgsrc="/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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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