Can't get rid of lots of nbsp in my cards

Hi, I use Anki to learn Spanish, I copy many definitions from the online RAE dictionary (which is the authoritative source for the language), no matter whether I paste them using Cmd-V or Cmd-Shift-V I’m unable to get rid of nbsps everywhere that wreak havoc with word wrapping. For example:

image

I know there is a plugin that replaces nbsps with proper spaces, but I believe this is so basic an issue that should be addressed by Anki itself. After all, I’m just copying definitions from the main dictionary for a massively spoken language.

  • Anki version: 2.1.62
  • System version: macOS Ventura 13.2

Regards,
Carlos

You could run a search and replace over all your cards and replace

 

with a whitespace.

Thank you. I’ve read about that workaround, for now I’ve created a shortcut to copy without formatting at the system level instead.

But the point of this post is to ask for an improvement. This has been reported many times in different places (e.g. many threads in Reddit). IMO there should be an option that actually strips all formatting whatsoever.

The problem is that if we just replaced all non-breaking spaces with normal ones, it would break the formatting of some content. For example, indented text is sometimes represented with non-breaking spaces, and it would lose its indent if we did that.

Then I believe you could add an option to actually strip all markup instead of applying the current heuristic. Paste-without-formatting works like that in most apps, after all.

Does it? I tested in the Notes app and Word, and in both cases nbsp indents are preserved even when matching the existing styling. I fear if Anki were to strip them, it may not be appreciated by some users.

1 Like

I don’t know what’s the internal representation in those apps, but I’ve never seen an app that does word wrapping as bad as Anki does, specially when pasting without formatting. For example:

 interj. U. como salutación familiar.  
 -->
 interj. U. como salu
tación familiar.

I can understand your pointe, but the main problem here are the nbsps inside the text that make the paragraph one single unsplittable item.

Maybe you can improve the heuristic by replacing single internal nbsps with a space char.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.