# How to import text (csv) keeping html tags intact?

**URL:** <https://forums.ankiweb.net/t/how-to-import-text-csv-keeping-html-tags-intact/24300>\
**Category:** Help\
**Created:** [October 29, 2022, 6:04am UTC](https://forums.ankiweb.net/t/how-to-import-text-csv-keeping-html-tags-intact/24300 "2022-10-29T06:04:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![brumby](https://avatars.discourse-cdn.com/v4/letter/b/76d3ee/32.png) [@brumby](https://forums.ankiweb.net/u/brumby)\
**Post date:** [October 29, 2022, 6:04am UTC](https://forums.ankiweb.net/t/how-to-import-text-csv-keeping-html-tags-intact/24300/1 "2022-10-29T06:04:36Z")

</div>

I need to import some cards from csv file with html tags in it keeping them intact as text. But when I import those cards the tags disappear.  
For example, the text

`when buses or trains <break time='0.8s'/>, they follow their usual route from one place to another`

turns into

`when buses or trains , they follow their usual route from one place to another`

The text `<break time='0.8s'/>` disappears.

So, how do I import cards from csv file keeping html tags intact as a regular text?

---

<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:** [October 31, 2022, 8:44am UTC](https://forums.ankiweb.net/t/how-to-import-text-csv-keeping-html-tags-intact/24300/2 "2022-10-31T08:44:22Z")

</div>

Anki’s editor does not show HTML by default. Clicking on `</>` should reveal it.

---

<div class="post-metadata">

**Author:** ![brumby](https://avatars.discourse-cdn.com/v4/letter/b/76d3ee/32.png) [@brumby](https://forums.ankiweb.net/u/brumby)\
**Post date:** [October 31, 2022, 12:20pm UTC](https://forums.ankiweb.net/t/how-to-import-text-csv-keeping-html-tags-intact/24300/3 "2022-10-31T12:20:00Z")

</div>

@dae, Yes, but that is the problem, I need to have these tags just as a plain text, but not as an actual html code.  
Also while importing strings from csv file, Anki changes the tags. For example the string

`...trains <break time='0.8s'/>, they follow...`

turns into

`...trains <break time="0.8s">, they follow...</break>`

Unpaired `<break time='0.8s'/>` tag turns into paired `<break time="0.8s"></break>` for some reason.  
I need to find a way to prevent Anki from doing that. Is there one?

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [October 31, 2022, 12:54pm UTC](https://forums.ankiweb.net/t/how-to-import-text-csv-keeping-html-tags-intact/24300/4 "2022-10-31T12:54:22Z")

</div>

Make sure the “Allow HTML in fields” option is disabled when importing.

---

<div class="post-metadata">

**Author:** ![brumby](https://avatars.discourse-cdn.com/v4/letter/b/76d3ee/32.png) [@brumby](https://forums.ankiweb.net/u/brumby)\
**Post date:** [October 31, 2022, 1:12pm UTC](https://forums.ankiweb.net/t/how-to-import-text-csv-keeping-html-tags-intact/24300/6 "2022-10-31T13:12:11Z")

</div>

@abdo It’s disabled.

---

<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:** [November 30, 2022, 1:12pm UTC](https://forums.ankiweb.net/t/how-to-import-text-csv-keeping-html-tags-intact/24300/7 "2022-11-30T13:12:35Z")

</div>

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