Cimbali / Cimbali/markdown-viewer
Native print shortcut prints outer document, resulting in document being cut off after first page
- Dominant language
- JavaScript
- Stars
- 177
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
When I did Ctrl+P to print a document after it got rendered by this extension, I noticed that it only showed one page in the preview, cutting off all content after the first page. After panicking about if it was my custom styles causing it, I figured out that the HTML layout of the extension's viewer page has changed since the last time I used it. There's now an `iframe` at the root of the document, and *that* is what contains the proper rendered markdown elements. Because it's an `iframe`, it doesn't participate in fancy CSS Print rules and such, and it gets cut off after it fills a page.
A workaround for now is to right-click the page, select "This Frame" and select "Print Frame" from the context menu.
A solution to this would be to maybe prevent default on the print shortcut and call `.print` on the iframe document.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by inspecting the viewer page's root iframe and the handling of the native Ctrl+P shortcut, then reproduce printing a multi-page rendered document. Done means the native shortcut prints the iframe's full rendered content rather than truncating the outer document after the first page.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100