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

Pasting from Powerpoint on Mac #1

Open
jvega023 opened this issue Jan 28, 2016 · 3 comments
Open

Pasting from Powerpoint on Mac #1

jvega023 opened this issue Jan 28, 2016 · 3 comments

Comments

@jvega023
Copy link

When I copy text from powerpoint and paste it into anki, the text is white with a black background, and this only happens when image resizer is installed.

screen shot 2016-01-28 at 9 31 13 am

becomes

screen shot 2016-01-28 at 9 31 17 am

@searene
Copy link
Owner

searene commented Jan 29, 2016

Open Tools --> Preferences, check Paste clipboard images as PNG, and try again. If it doesn't work, you can send the powerpoint to my email: mycityofsky@gmail.com, and I'll check if anything goes wrong.

@jvega023
Copy link
Author

Sorry, I'm not sure I explained myself correctly, but in powerpoint, I'm selecting the text, and trying to paste the text ONLY into anki, not images. Image resizer works great when I'm pasting images, but when pasting text, this happens.

But it's only text from a powerpoint, if I copy it from other apps, like Word, or Notes, it doesn’t occur.

@searene
Copy link
Owner

searene commented Jan 30, 2016

I tested the addon on Mac OS X, and I could only reproduce the problem when HTML was not stripped. I suggest that you go to Tools --> Preferences, and check Strip HTML when pasting text. The reason why the background was black and the font color was white was that you pasted CSS styles in it, too.

If you want to reserve HTML, and keep the right color, you can download my another addon PurgeAttributes. I haven't uploaded the addon on ankiweb yet, but you can still use it. Download PurgeAttributes.py, then open anki, Tools --> Add-ons --> Open Add-ons Folder, and paste PurgeAttributes.py you downloaded into the Add-ons Folder. But there's still a problem, because the font color in your powerpoint is white and the background in anki is also white too, it's impossible to see these white characters without any modification. So you should purge the font color attribute too. Open PurgeAttributes.py in your anki add-ons folder, and change the following line:

REMOVE_ATTRIBUTES = [
        'font-family',
        'font-size',
        'background-color',
        'line-height',
]

to

REMOVE_ATTRIBUTES = [
        'color',
        'background-color',
]

It might be hard if you are not a developer. I've sent you an email with the needed PurgeAttributes.py file attached. Just put it under your Anki Add-ons folder(it's usually /Users/username/Documents/Anki/addons).

And also notice, you could easily solve the problem by checking Strip HTML when pasting text without installing PurgeAttributes.

Sorry that I didn't customize the addon for Mac OS X because I didn't own one. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants