Skip to content

Sidebar level link does not work if header starts with numbers #1088

Description

@StanleyWei

Bug Report

Thanks for this great app and I just got one issue for now, if the header text in the document starts with numbers, the auto links in the sidebar will not work. For example:

Header text in the document as follows:

  1. Introduction
    1.1 Purpose

The auto links will be resolved as like http://localhost:3000/#/mybook?id=1-introduction, it will not redirect to the right section when this link was clicked.

If I add any other characters before that, e.g. Chapter 1 Introduction, then it works very well.

I am wondering whether it could support this kind of scenario, or it does support and I may miss something in configuration, please advise. Thanks very much!

Steps to reproduce

  • Change the header text with number started
  • Enable sidebar and ensure the maxlevels include the corresponding header texts
  • Click the sidebar level link

What is current behaviour

  • Sidebar level link does not work if header text starts with numbers, like 1. Overview

What is the expected behaviour

  • Enable auto links of header text to support leading numbers.

Other relevant information

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

  • Your OS: Windows WSL

  • Node.js version: v10.16.3

  • npm/yarn version: 6.14.3

  • Browser version: Firefox 74.0

  • Docsify version: docsify-cli 4.4.0

  • Docsify plugins: default

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