Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jhildenbiddle opened this issue Jul 12, 2018 · 0 comments

Comments

@jhildenbiddle
Copy link
Member

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant