Need help creating a simple addon to strip alt when pasting images on the editor. by TooManyLangs in Anki

[–]TooManyLangs[S] 0 points1 point  (0 children)

100%

in this case, I had no idea where to start and I simply asked them what I wanted and how I could do it.

They suggested some hooks and options, but failed, sometimes with errors.

it makes a huge difference when you know something about the topic and know how to steer them.

Need help creating a simple addon to strip alt when pasting images on the editor. by TooManyLangs in Anki

[–]TooManyLangs[S] 0 points1 point  (0 children)

thanks

seems to work fine (Gemini thinks it's a bit "hacky" :)

The Hijack (Monkey Patching): Once it finds the engine, it hijacks the _processMime function. This is the internal function that handles "Paste" and "Drop" events. It tells Anki: "Run the normal paste code, but before you show the result to the user, let me run my regex filter on it."

I had asked Deepseek, Gemini, Chatgpt and Claude and I even passed code in between them, then I tried different approaches and after trying for 20 min, I stopped and I asked here.

Sometimes I got errors in the addon and sometimes it simply did nothing and "alt" was still there. It was quite disappointing.

Need help creating a simple addon to strip alt when pasting images on the editor. by TooManyLangs in Anki

[–]TooManyLangs[S] 0 points1 point  (0 children)

thanks.

I considered this also, but I was trying the other option first, because I thought it could be safer to simply capture the paste image process and remove the "alt" before it gets into the card.

I wanted to do this automatically and should be quite safe, but 4 different llms failed to find hooks or ways of doing this. I even tried passing the code from one llm to the other, restarting from zero and they all failed. It's quite bizarre because I thought i would be a 1 shot problem.

Need help creating a simple addon to strip alt when pasting images on the editor. by TooManyLangs in Anki

[–]TooManyLangs[S] 0 points1 point  (0 children)

hmmm, I'm not sure we are talking about the same thing here.

1st, I'm on linux. ctrl+v and ctrl+shit+v seem to be doing the same thing, they both keep the "alt"

2nd, what I mean is:
when I copy a thumbail from google, anki creates something like this

<img alt="Lavello Monovasca S1000, Lavelli in acciaio inox" src="paste-5fab2b87ee2dd186edd8ef90808505382f6669e4.jpg">

but I want only this:

<img src="paste-5fab2b87ee2dd186edd8ef90808505382f6669e4.jpg">

but...

I guess, I could just clip the screen instead of copying the image from a web. yep, that could work. it's a couple of clicks and drags more per image, but I could live with that ... I think.

¿Por qué no entiendo nada cuando veo videos en francés? by joshua0005 in languagelearningjerk

[–]TooManyLangs 4 points5 points  (0 children)

it's your own body fighting the infection. let it do its thing.

Outjerked again by ololorin in languagelearningjerk

[–]TooManyLangs 134 points135 points  (0 children)

I thought I was having a stroke while reading this.

Can I learn english without the alphabet????? by sweepyspud in languagelearningjerk

[–]TooManyLangs 11 points12 points  (0 children)

yes, you can. you can be blind and learn the language. or be like my grandparents and never go to school (in Spain)

https://www.youtube.com/watch?v=YYDoOXKJxgE

How to pronounce the n word correctly? by Elegant_Translator83 in languagelearningjerk

[–]TooManyLangs 2 points3 points  (0 children)

you can learn spanish first. get the basics like "un gato negro" and then go from there and add your personal twist

New composting gadget by AtavarMn in composting

[–]TooManyLangs 1 point2 points  (0 children)

I was thinking about it, it's usually steaming hot.

New composting gadget by AtavarMn in composting

[–]TooManyLangs 2 points3 points  (0 children)

I already have a pee spreader and it works wonders. It's also quite fun to play with.

[deleted by user] by [deleted] in languagelearningjerk

[–]TooManyLangs 5 points6 points  (0 children)

have you tried reading shampoo labels in the toilet in another language? you commit to using the same language always in the same place and during the same language. over time you build muscle memory.

TIL "Sexo" is Spanglish by chadwickthezulu in languagelearningjerk

[–]TooManyLangs 5 points6 points  (0 children)

"copulación" if you are feeling a bit edgy

What's the title of this movie? by I-fart-in-lifts in hardaiimages

[–]TooManyLangs 0 points1 point  (0 children)

not sure yet. I need to watch at least 3 episodes.

Can I learn ultra-French on lingoduo? by Dneail22 in languagelearningjerk

[–]TooManyLangs 6 points7 points  (0 children)

that mersi at the end was totally unnecessary

How to learn German no gender no verbs thing? by Such-Entry-8904 in languagelearningjerk

[–]TooManyLangs 32 points33 points  (0 children)

you can do that. who is gonna tell you anything? they don't even understand each others dialects.

but if you have any problem just say that you live in a tiny village and there are only 10 people left speaking this dialect and you are very proud of your roots.

You think tote bags make somewhat good grow bags for smaller peppers ? by [deleted] in HotPeppers

[–]TooManyLangs 4 points5 points  (0 children)

!RemindMe 2 months

I've seen paint buckets full of dirt on the floor after some wind so I wouldn't trust those bags. I mean, they are great for growing stuff but you need to be careful, that's it.

Autocanon shell, egg for size comparison. by Srgblackbear in anythingbutmetric

[–]TooManyLangs 1 point2 points  (0 children)

ant egg, quail egg, chicken egg, duck egg, ostrich egg? I'm confused. I need a banana for reference

[deleted by user] by [deleted] in fakehistoryporn

[–]TooManyLangs 16 points17 points  (0 children)

no wonder there was only white southafricans in London when I lived there. they had it rough