Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single-line code annotations disappear when printing #3089

Closed
5 tasks done
lampensau opened this issue Oct 6, 2021 · 4 comments
Closed
5 tasks done

Single-line code annotations disappear when printing #3089

lampensau opened this issue Oct 6, 2021 · 4 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@lampensau
Copy link

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
@squidfunk
Copy link
Owner

squidfunk commented Oct 7, 2021

Good catch, definitely a bug. I'm currently in the process of fixing all issues reported for code annotations. I'll revisit this issue as part of this undertaking, which will also fix all alignment and positioning issues in #2475.

Temporary workaround: as you already realized, putting a newline between annotations temporarily fixes the issue.

@squidfunk squidfunk added the bug Issue reports a bug label Oct 7, 2021
@squidfunk squidfunk changed the title Code annotations are not printed Single-line code annotations disappear when printing Oct 7, 2021
@squidfunk
Copy link
Owner

Fixed in 8b11bfb.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Oct 11, 2021
@lampensau
Copy link
Author

I can confirm. Annotations are now printed correctly.

@squidfunk
Copy link
Owner

Released as part of 7.3.3-insiders-3.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants