Skip to content

instant.preview is not working properly #8544

@Xiaokang2022

Description

@Xiaokang2022

Context

No response

Bug description

My configuration is as follows:

site_name: My Docs
site_url: https://example.com

markdown_extensions:
  - attr_list

theme:
  name: material
  features:
    - navigation.instant.preview

And the content of my index.md is as follows:

# Welcome to MkDocs

For full documentation visit [mkdocs.org](https://www.mkdocs.org).

## 命令

* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.

## Project layout

    mkdocs.yml    # The configuration file.
    docs/
        index.md  # The documentation homepage.
        ...       # Other markdown pages, images and other files.

[Link1](#命令){data-preview}

[Link2](#project-layout){data-preview}

The actual effect is that instant.preview on Link2 works normally, while instant.preview on Link1 does not.

This situation occurs not only with mkdocs-material, but also with zensical.

Related links

Reproduction

9.7.0-instant-preview-bug.zip

Steps to reproduce

  1. mkdocs serve or zensical serve
  2. Move the mouse over the two links to see the effect

Browser

No response

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions