This is an automated archive made by the Lemmit Bot.
The original was posted on /r/foundryvtt by /u/florabtw on 2023-11-01 00:17:38.
Hey everyone,
If you copy from PDFs a lot, it’s a pain the rear to remove line breaks all the time, and the clear formatting button doesn’t do it. I spent some time writing up a macro to solve this for me:
const text = getSelection().toString().replaceAll(/\r?\n/g, ' ');
const element = getSelection().anchorNode.parentElement.closest('p');
element.innerText = text;
Macro setup:
- Click empty spot in macro toolbar
- Name your macro (e.g. “Remove Line Breaks”)
- Set “type” to Script
- Paste the above code
Steps:
- Copy & paste paragraph from PDF
- Highlight paragraph (full paragraph!) in Journal
- Execute macro
Tips:
- Only works for entire paragraphs (don’t try to do this for half a paragraph)
- Keep the macro editor open, and just click “Execute Macro” whenever you need it.
You must log in or register to comment.