Skip to content

Single-line code annotations disappear when printing #3089

@lampensau

Description

@lampensau

Contribution guidelines

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

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

I've noticed that my code annotations only appear with their numbering on the printed output on Firefox 93.0 and Chrome 94 when using the example provided in the documentation.

Expected behaviour

Code annotations should be fully visible and printed below a code block.

grafik

Actual behaviour

Only the list numbers are visible below a code block.

grafik

Steps to reproduce

  1. Create a new mkdocs project mkdocs new ..
  2. Use the configuration posted below.
  3. Edit the index.md:
    # Welcome to MkDocs
    
    For full documentation visit [mkdocs.org](https://www.mkdocs.org).
    
    ## Testing
    
    ``` js
    document$.subscribe(function() { // (1)
      var tables = document.querySelectorAll(/* (2) */ "article table")
      tables.forEach(function(table) {
        new Tablesort(table)
      })
    })
    ```
    
    1. Annotation 1
    2. Annotation 2
  4. Build documentation and print index.html

P.S. Workaround seems to be a new-line between the list elements:

# Welcome to MkDocs

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

## Testing

``` js
document$.subscribe(function() { // (1)
  var tables = document.querySelectorAll(/* (2) */ "article table")
  tables.forEach(function(table) {
    new Tablesort(table)
  })
})
```

1. Annotation 1

2. Annotation 2

Package versions

  • Python: 3.9.2
  • MkDocs: 1.2.2
  • Material: 7.3.2+insiders.3.1.2

Configuration

site_name: 'My Docs'

theme:
  name: material
  features:
    - content.code.annotate

markdown_extensions:
  - pymdownx.highlight
  - pymdownx.superfences

System information

  • Operating system: Windows 10
  • Browser: Chrome 94.0.4606.71, Firefox 93.0

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