Skip to content

Printing page with annotation includes list marker and annotation number #8204

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

Open
4 tasks done
joapuiib opened this issue May 6, 2025 · 1 comment
Open
4 tasks done
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@joapuiib
Copy link
Contributor

joapuiib commented May 6, 2025

Context

No response

Bug description

Both ::marker and ::before are shown in annotations when printing a page using pymdownx.fancylists extension.

markdown_extensions:
  - attr_list
  - pymdownx.fancylists

Printed content:
Image


This is due because pymdownx.fancylists sets lists type. The current CSS rule for handling these overrides the annotation styles.

.md-typeset ol[type], .md-typeset ul[type] {
    list-style-type: revert-layer;
}

.md-typeset .md-annotation-list {
    counter-reset: xxx;
    list-style: none;
}

Possible fix:

.md-typeset .md-annotation-list {
    counter-reset: xxx;
    list-style: none !important;
}

Related links

Reproduction

9.6.12-annotations-number-print.zip

Steps to reproduce

  1. Print the landing page.

    Also, window.dispatchEvent(new Event("beforeprint")); shows the issue.

  2. Check that the annotation has both ::marker and ::before.

Browser

Chrome

Before submitting

@squidfunk
Copy link
Owner

Thanks for reporting, investigating and providing a fix! Indeed, we need to use !important here, which I just added in 572da4f.

@squidfunk squidfunk added bug Issue reports a bug resolved Issue is resolved, yet unreleased if open labels May 6, 2025
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