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

pdf cut off long code in code block #26

Open
spxvszero opened this issue May 10, 2019 · 8 comments
Open

pdf cut off long code in code block #26

spxvszero opened this issue May 10, 2019 · 8 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@spxvszero
Copy link

No description provided.

@realdennis
Copy link
Owner

Thanks for your feedback, could you reproduce this bug and tell me the browser details?

@spxvszero
Copy link
Author

QQ20190513-101730@2x

like this

@realdennis realdennis added the enhancement New feature or request label May 18, 2019
@realdennis realdennis added the help wanted Extra attention is needed label Dec 11, 2019
@nilesr
Copy link

nilesr commented Jan 28, 2020

Also interested in seeing this changed. If I can get it working locally I will submit a PR. I unfortunately need to submit an assignment as a PDF which includes a hand-written regular expression that is 541 characters long. I definitely need code blocks to wrap or it will get cut out.

@nilesr
Copy link

nilesr commented Jan 29, 2020

So by changing the rule in github-markdown.css line 706 from white-space: pre to white-space: pre-wrap will wrap text correctly. It is matched by a selector on line 700, .markdown-body pre>code.

I would make a pull request to add a simple checkbox to the left of the "Choose" button to toggle wrapping code blocks, but I couldn't get it to start locally with just an npm i and npm start, I get this error

./node_modules/create-event-target-hook/dist/index.mjs
Can't import the named export 'useCallback' from non EcmaScript module (only default export is available)

I don't have enough experience with react applications to figure out how to fix it, so I'm just going to apply the style in the devtools to export my current assignment. It does work correctly, even after exporting to PDF.

Before:

2020-01-28-191354_842x370_scrot

After:

2020-01-28-191419_951x426_scrot

These are both screenshots of my PDF reader, after export.

@miku86
Copy link

miku86 commented Aug 20, 2020

Hey there,

I can reproduce @nilesr post,
got this error too.

Reproduction:

./node_modules/create-event-target-hook/dist/index.mjs
Can't import the named export 'useCallback' from non EcmaScript module (only default export is available)

OS: Arch Linux 5.4.58-1-lts
Node: v12.18.3


I updated the version of create-event-target-hook from 1.2.2 to 1.3.1, but that didn't work.

In the end, I solved it by:

  • index.js: L11: remove import createEventTargetHook from 'create-event-target-hook';
  • index.js: L12: remove const useWindowEvent = createEventTargetHook(window);
  • index.js: L23: remove useWindowEvent('mouseup', () => setDrag(false));

Greetings
Michael

@realdennis
Copy link
Owner

@nilesr @miku86 seems it's the issue in my dependency which is also owned by me, will figure out how fix, and update later, sorry for lately reply, and thanks for your kindly help!

@realdennis
Copy link
Owner

realdennis commented Aug 20, 2020

There's a quick hot fix to workaround this issue when develop

change here

import createEventTargetHook from 'create-event-target-hook';

- import createEventTargetHook from 'create-event-target-hook';
+ import createEventTargetHook from 'create-event-target-hook/dist/index.js';

Not really sure why it uses emodule when develop, it's supposed to run build before, you can just workaround or check if there's a outdated react-scripts or somehow, feel free to pull the request.

It works on node v10.

@hacklschorsch
Copy link
Contributor

Please don't add an option, just fix it with a good default instead.
Having too many options is what screws up most FLOSS app's usability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants