Skip to content

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

Closed
@UserR00T

Description

@UserR00T

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

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