# Weird HTML tags in content

**URL:** https://forums.ankiweb.net/t/weird-html-tags-in-content/29087
**Category:** Help
**Created:** [April 5, 2023, 12:56pm UTC](https://forums.ankiweb.net/t/weird-html-tags-in-content/29087 "2023-04-05T12:56:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![maxprocess](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/maxprocess/32/13904_2.png) [@maxprocess](https://forums.ankiweb.net/u/maxprocess)
#### Post date: [April 5, 2023, 12:56pm UTC](https://forums.ankiweb.net/t/weird-html-tags-in-content/29087/1 "2023-04-05T12:56:14Z")

</div>

![Screenshot_2023-04-03-15-47-35-08_a9eef3a2a561b80d5c76daebd0f9a14c](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/2X/f/ffac5dd62a90ee762cbe2b75bcab243323967d03.jpeg)

Hi,

Here’s the problem I get when creating a card with Anki Desktop (mac) and read it in AnkiDroid. It’s been something like a year since this bug occurred (cause I never had this issue before). When I paste some text from the web, I use the CMD+shift shortcut which removes any formatting and it looks ok when I save the  
card in Anki Desktop. If I open the card in AnkiDroid, several blocks can be on a single line and I need to manually remove the & npsp; HTML chars for the line break to work as it used to a while ago.

kind regards.

---

<div class="post-metadata">

### Author: ![kleinerpirat](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/kleinerpirat/32/19863_2.png) [@kleinerpirat](https://forums.ankiweb.net/u/kleinerpirat)
#### Post date: [April 5, 2023, 5:25pm UTC](https://forums.ankiweb.net/t/weird-html-tags-in-content/29087/2 "2023-04-05T17:25:21Z")

</div>

Those are non breaking spaces and they usually come from PDF content or heavily formatted web pages. You’re seeing them in AnkiDroid because its editor displays the raw field HTML, but [they are there in Anki Desktop too](https://forums.ankiweb.net/t/weird-html-tags-in-content/29087).

I made this add-on a while ago that automates the removal of those: [nbspRemover - AnkiWeb](https://ankiweb.net/shared/info/1676672391)

The reason Anki doesn’t remove them by default is that some people actually use those to format text (I think).

* * *

In my whole time on the forum I only came across a single person who said the character was useful to them. Maybe we should reconsider the current behavior.

---

<div class="post-metadata">

### Author: ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)
#### Post date: [April 6, 2023, 3:08am UTC](https://forums.ankiweb.net/t/weird-html-tags-in-content/29087/3 "2023-04-06T03:08:50Z")

</div>

I do worry about unintended side-effects. One alternative I’ve thought about in the past is making the default notetypes use white-space: pre-wrap. It would mean multiple spaces would no longer get converted into nbsp, and newlines would work with \n instead of requiring a `<br>`. The big question would be how it worked with pasted/imported content though - at the least I guess we’d need to strip out newlines and collapse whitespace when pasting in.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)
#### Post date: [May 6, 2023, 3:09am UTC](https://forums.ankiweb.net/t/weird-html-tags-in-content/29087/4 "2023-05-06T03:09:17Z")

</div>

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