Skip to content

Allow logo option to treat any value as src (external, base64, relative, etc.) #577

Closed
@jhildenbiddle

Description

@jhildenbiddle

Docsify assumes the logo option value is an absolute path. This prevents the use of several valid image src values.

Example:

logo: "logo.svg"

Output:

<img alt="docsify-themeable" src="/logo.svg">

Notice the auto-inserted forward slash at the beginning of the src attribute. This behavior prevents valid image sources from being used:

Base64:

logo: "data:image/png;base64, ..."
<img alt="docsify-themeable" src="/data:image/png;base64, ...">

Relative path:

logo: "../logo.svg"
<img alt="docsify-themeable" src="/../logo.svg">

External URL:

logo: "https://docsify.js.org/_media/icon.svg"
<img alt="docsify-themeable" src="/https://docsify.js.org/_media/icon.svg">

The fix seems straightforward: just use the logo option value as-is for the image src.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions