Skip to content

When 'logo' is set, 'name' is not escaped properly inside the 'alt' field. #972

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

Closed
1 task done
UserR00T opened this issue Dec 5, 2019 · 0 comments · Fixed by #974
Closed
1 task done

When 'logo' is set, 'name' is not escaped properly inside the 'alt' field. #972

UserR00T opened this issue Dec 5, 2019 · 0 comments · Fixed by #974

Comments

@UserR00T
Copy link

UserR00T commented Dec 5, 2019

Bug Report

When window.$docsify.logo is set, window.$docsify.name does not get escaped properly.

Steps to reproduce

  1. mkdir test && cd test
  2. docsify init . && docsify serve .
  3. set window.$docsify.name to " and window.$docsify.logo to a random image.

What is current behaviour

It sets it as raw HTML value instead of the alt text.

<!-- 'window.$docsify.name' -> 'hello test"'-->
<!-- 'window.$docsify.logo' -> 'https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/1200px-Cat03.jpg"'-->
<img alt="hello" test"="" src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/1200px-Cat03.jpg">


When no image is provided, it does get escaped properly:

What is the expected behaviour

Correctly escaping " to &quot; and others (space, etc) or using escaping it using something else.

Other relevant information

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

  • Your OS: Windows 10 1903

  • Node.js version: 12.13.1

  • npm/yarn version: 6.13.2

  • Browser version: 78.0.3904.108

  • Docsify version: Latest 4.9.4 (//unpkg.com/docsify/lib/docsify.min.js)

  • Docsify plugins: None

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