Hello, Firstly I would like to say thank you for such a great plugin!
Now on to an issue that I have discovered. When a visitor tries to print an article that contains code (displayed via your plugin) it does not print all the code but instead only renders what can be seen on-site.
Is there a way to have it include all the code for the print only version?
To duplicate this issue, visit my site, scroll to the bottom and where the share icons are you can click on the Print button or simply select Print from your browser. Now look at the code section in the print preview.
Hope there is a solution to this other than being told to display all the code in the article as this would make for a massively unreadable article causing the reader to have to scroll past every bit of code before continuing on.
The page I need help with: [log in to see the link]
If you’d like the code to add some text before, you can try this:
@media print {
.wp-block-kevinbatdorf-code-block-pro:not(#x)::before {
content: "Note: This code may be improperly formatted when printing";
display: block;
}
}
This reply was modified 3 months ago by Kevin Batdorf.
I have temporarily removed all custom @media print CSS from my site. See for yourself that the wrapping issue is still there. This is how everyone will see a generic site I guess.
That seems to be wrapping lines as needed allowing the full lines to be seen and read clearly. Nice job!
See below for latest results:
Suggestion, are you able to do anything about the width so that it fills from the left to right margin? I obviously understand it depends what the site creator has these margins set to in their CSS but it would be nice if it spanned to fill.
The above is showing at the same width as it is on the website regardless of said page margins imposed with media print.
I can confirm, that when removing my sites side bar so that the post content spanned the full width, it printed at that width too.
Now the only thing missing is a border around the code when printed so it’s easier to see where the lines wrap. Or better still, just a 1px line down the right hand side of the wrapper.
What is the class name of the element I need to apply this to please?
I’m not near my PC at the min and finding out stuff like this on an iPhone will destroy my sanity 😂
Also, just wondering if this little change will be included in an update to the core plugin?
Very tiny issue noticed. Say a word gets wrapped due to reaching the right hand side border. Well it is split as opposed to being moved wrapping fully.
EG: Using the word function as an example. This would show ‘funct’ on the right, then ‘ion’ on the left as it wraps.
Anyway to make it so that if a full word is wrapping to move the entire word?