Skip to content

"href" of sidebar headers #1069

Closed
Closed
@Erimus-Koo

Description

@Erimus-Koo

Bug Report

This maybe should be a feature request, I'm not sure.
I just tell what happen and what I expect.

Steps to reproduce

In markdown file, wrote a header with link, like:

## [chapter](https://wikisource.com/chapter)

and use sidebar.

What is current behaviour

In sidebar, if you click chapter and chapter is a normal header(without link), it will guide you to the position(y scroll) of chapter in page. (this is normal case)

But if the chapter header has had a href, click the title chapter in sidebar, will open a new page with "https://wikisource.com/chapter".

What is the expected behaviour

In sidebar, whether or not I have a link, click should always bring me to the correct position in the doc.

And if I click the "chapter" header (with link) in the doc, then go open the link in new page.

Sidebar should always be a “navigation”, a guide to position in doc, not to outside.

Other relevant information

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

Your OS: win10 1909
Node.js version: 10.12.0
npm/yarn version: 6.4.1
Browser version: chrome Version 80.0.3987.132 (Official Build) (64-bit)
Docsify version: 4.11.2
Docsify plugins: I've remove all plugins, its same.


I've tried to change it like

## chapter [🔗](https://wikisource.com/chapter)

The sidebar will display "chapter-🔗", in two lines (because of css display:block).
Click chapter, go the position in doc, it works. And click 🔗, go outside site page, its fine. Then I can modify the css to make them in one line.

But I still wish you can consider about this.
And thanks for your time.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions