question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The first h1 header is ignored in sidebar

See original GitHub issue

Bug Report

As the title suggests, the first h1 markdown header is ignored in sidebar.

Steps to reproduce

Let’s say we have two h1 headers ‘a’ and ‘b’, for each one of them, we have three h2 sub-headers a.1, a.2, a.3, and b.1, b.2, b.3 respectively. The output will be as if a.1, a.2, a.3, and b are h1 headers and b.1, b.2, b.3 as h2 sub-headers.

What is current behaviour

In other words, the input is :

# a
## a.1
## a.2
## a.3
# b
## b.1
## b.2
## b.3

and the generated sidebar looks like the following :

# a.1
# a.2
# a.3
# b
## b.1
## b.2
## b.3

a is ignored and all of its content (sub-headers) levels up!

What is the expected behaviour

The expected behavior is to have the same hierarchy as the original input.

Other relevant information

However, I have found a hack to fix this, just add an empty first header to replace the one ignored. i.e. the input becomes :

#  
# a
## a.1
## a.2
## a.3
# b
## b.1
## b.2
## b.3
  • Your OS: Ubuntu 18.04
  • Node.js version: v8.10.0
  • npm/yarn version: npm 6.12.0
  • Browser version: Google Chrome 80.0.3987.132
  • Docsify version: docsify-cli 4.4.0
  • Docsify plugins: Copy to Clipboard + Language Highlight (Python) + Full Text Search

Please create a reproducible sandbox

I tried to reproduce the same case on codesandbox.io but I couldn’t, this is an error related to their website not to docsify.

Mention the docsify version in which this bug was not present (if any)

I’m using one version only, the latest one.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
glaucolemecommented, Sep 29, 2020

The issue also happened with me. As @stoufa shown, adding the #   before the first header hides the problem.

Your OS: Ubuntu 18.04.5 LTS Node.js version: v12.18.4 npm/yarn version: npm 6.14.6 Browser version: Edge Version 85.0.564.63 (Official build) (64-bit) Docsify version: docsify-cli 4.4.1 Docsify plugins: none

1reaction
Koooooo-7commented, Mar 30, 2020

I create a initialization docsify project (docsify init ./docs).
and edit the README. md


# a
## a.1
## a.2
## a.3
# b
## b.1
## b.2
## b.3

the sidebar rendered correctly.

so, I think u could create a simple demo likes this. if the bug isn’t reproducible, I guess there may have others configurations/content get it broken. otherwise we could investigate the environment problems.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What heading tag to use on sidebars and footers | SEO Forum
Hello, I have some awareness of how to use H1, H2 and H3. H1 only once per page as the main page heading....
Read more >
Headings | Web Accessibility Initiative (WAI) - W3C
In this first example, the heading with the rank 1 is the first heading in the document. All other headings for structuring the...
Read more >
How to target specific h1 header - css - Stack Overflow
h1.entry-title targets all h1 elements with the entry-title class. If there is only one, that is all it will target.
Read more >
Incorrect Heading Order - Equalize Digital
An Incorrect Heading Order error means your heading structure has skipped over a level. For example, if your page structure has a level...
Read more >
Yoast claims I have H1, but I don't have them - WordPress.org
As long as your source code has one H1, the warning can be ignored. Please note that it's better to have one H1...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found