Closed jippi closed 2 weeks ago
This seems to have been introduced in one of the recent Material releases. Locally, I had mkdocs-material-9.5.6
, but after updating to mkdocs-material-9.5.21
, I was able to reproduce the issue.
I should note that I could only reproduce with the line_spans: __span
option. I suspect that the copy logic gets tripped up by line spans and injects extra new lines. That is my guess at least.
Thanks for reporting. Please provide a minimal reproduction, as requested by our bug reporting guidelines.
Bisecting releases, it works as expected in 9.5.17
and fails in 9.5.18
and above; and removing line_spans: __span
makes it work across all versions
Fixed in 937d7ccff103c96be0fa086cb30909bb1844b1fc. I was able to reproduce it and found out that it's related to https://github.com/squidfunk/mkdocs-material/commit/4eb1a4393741b1ecf8019dd53292b7a4d02e16f5, which fixes line highlights on mobile, but introduced the side effect of empty lines when copying.
You did 'Fixed empty lines when copying (9.5.18 regression)'. Do we need to install specific version 9.5.18? An upgrade would install 9.5.21 again.
I'm in the process of creating a release for this. "9.5.18 regression" means the bug was introduced in 9.5.18 and it worked before, which was confirmed by the OP, saying that downgrading to 9.5.17 fixes the issue.
Thank you @squidfunk ❤️
Context
I want to make it easier for folks to copy configuration examples from my documentation page, by using the
copy
feature.Bug description
When clicking the
copy
icon in allcode
blcoks on my documentation site, I get extrablank
newlines in between the content.I initially thought it was due to Annotations in code blocks, but does not seem to be the case.
Manually "drag cursor over text and copy" works fine.
Related links
Reproduction
Click any
copy
icon from myrelated links
section and see that you get double newlinesFor example; the
Generate labels via script
code block:Expected
Actual
Steps to reproduce
copy
iconBrowser
No response
Before submitting