Skip to content

Discrepency between TOC component and auto sidebar #1399

Open
@13protons

Description

@13protons
  • I confirm that this is an issue rather than a question.

Bug report

Version

0.14.10

Steps to reproduce

  • Turn on auto sidebar in config.js
  • Create a page that has headings with gaps (i.e. an h3 inside an h1)
  • Add the [[toc]] component to the page
  • Observe a discrepancy between TOC and auto sidebar

This works:
this markdown works

With expected output:
auto sidebar picks up h3s when h2 is present

This doesn't (notice ### preceding 'Underlying' vs ##)
this markdown doesnt work

With this output highlighting difference between sidebar and TOC
auto sidebar ignores h3 without h2 despite toc working ok

What is expected?

Auto sidebar would index all headers on page (same as TOC)

What is actually happening?

Auto sidebar skips indexing headers if there's a gap in header hierarchy. It will render an h3 contained in an h2, contained in an h1, but will not render an h3 contained in an h1. the [[toc]] build-in does not have this problem.

Other relevant information

  • Your OS: MacOS Mojave v10.14.2
  • Node.js version: v8.10.0
  • Browser version: Chrome Version 71.0.3578.98 (Official Build) (64-bit)
  • Is this a global or local install? Local
  • Which package manager did you use for the install? NPM
  • Does this issue occur when all plugins are disabled?

Metadata

Metadata

Assignees

Labels

topic: markdownRelates to VuePress markdowntype: enhancementRequest to enhance an existing feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions