Skip to content

Regression in 4.4.0 escapes mkdocstrings ::: annotation which breaks mkdocs docstring import. #56

@alec-bike

Description

@alec-bike

With the latest mdformat-mkdocs 4.4.0, mkdocstrings ::: annotations are escaped (\:::) which breaks the mkdocs docstring import. This does not happen with 4.3.0.

Steps to reproduce (I'm using pre-commit, so this is how I fix the version of mdformat-mkdocs).

  1. Baseline -- works with 4.3.0
  - repo: https://github.com/hukkin/mdformat
    rev: 0.7.22
    hooks:
      - id: mdformat
        args: [--check]
        additional_dependencies:
          - mdformat-footnote
          - mdformat-mkdocs==4.3.0
mdformat.................................................................Passed
- hook id: mdformat
- duration: 0.11s
  1. Regression -- error with 4.4.0
          - mdformat-mkdocs==4.4.0
mdformat.................................................................Failed
- hook id: mdformat
- duration: 0.11s
- exit code: 1

Error: File "/Users/.../some_file.md" is not formatted.

After running mdformat, the diff on some_file.md is:

::: my_lib.core
\::: my_lib.core

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