Skip to content

Code annotations with extra comments have a wrong ID #2444

@JulioV

Description

@JulioV

I've found a bug and checked that ...

  • [x ] ... the problem doesn't occur with the default MkDocs template
  • [ x] ... the problem is not in any of my customizations (CSS, JS, template)
  • [ x] ... the documentation does not mention anything about my problem
  • [ x] ... there are no open or closed issues that are related to my problem

Description

Comments that are not annotations are counted as one, so the next annotation ID is wrong.

For example, for:

PHONE_ACCELEROMETER: # (1)
ANOTHER: 1 # not an annotation
CONTAINER: accelerometer # (2)

Expected behavior

PHONE_ACCELEROMETER: (1)
ANOTHER: 1 # not an annotation
CONTAINER: accelerometer (2)

Actual behavior

PHONE_ACCELEROMETER: (1)
ANOTHER: 1 # not an annotation
CONTAINER: accelerometer (3)

Steps to reproduce the bug

  1. ...
  2. ...
  3. ...

Package versions

  • Python: python --version 3.7.9
  • MkDocs: mkdocs --version 1.1.2
  • Material: pip show mkdocs-material | grep -E ^Version Version: 7.0.6+insiders.2.3.1

Project configuration

The contents of your mkdocs.yml

System information

  • OS: Mac
  • Browser: Firefox

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions