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

Highlighting specific lines adds blank lines when copying #3360

Closed
squidfunk opened this issue Dec 17, 2021 Discussed in #3359 · 4 comments
Closed

Highlighting specific lines adds blank lines when copying #3360

squidfunk opened this issue Dec 17, 2021 Discussed in #3359 · 4 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@squidfunk
Copy link
Owner

Discussed in #3359

Originally posted by andrewetchen December 17, 2021
Hi everyone,

Using the copy-to-clipboard on code blocks with highlighted lines, extra lines are being added when pasted.

Using the highlighting specific lines Result as an example. The copy-to-clipboard produces extra lines when pasted:

image

Produces:

def bubble_sort(items):

    for i in range(len(items)):

        for j in range(len(items) - 1 - i):

            if items[j] > items[j + 1]:
                items[j], items[j + 1] = items[j + 1], items[j]

Current markdown_extensions

markdown_extensions:
  - admonition
  - attr_list
  - meta
  - pymdownx.details
  - pymdownx.highlight:
      linenums: true
  - pymdownx.inlinehilite
  - pymdownx.magiclink:
      repo_url_shortener: true
  - pymdownx.tabbed:
      alternate_style: true
  - pymdownx.superfences

Adding the following CSS is a workaround to get around this but not ideal:

.highlight .hll {
  display: inline;
}

Best regards,
Andrew

@squidfunk squidfunk added the bug Issue reports a bug label Dec 17, 2021
@abhiTronix
Copy link

Yes, I'm facing this bug too.

@squidfunk
Copy link
Owner Author

Fixed in be0a36d.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Dec 19, 2021
@squidfunk
Copy link
Owner Author

Released as part of 8.1.3.

@andrewetchen
Copy link

Thanks for shipping this so quickly @squidfunk

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

3 participants