<div> tags there

920 views
Skip to first unread message

exsudat82

unread,
Mar 2, 2013, 10:24:17 AM3/2/13
to anki-a...@googlegroups.com
If I add new notes with Anki 2.0.8 on Kubuntu (Linux) everything looks fine.

If I read the cards with AnkiDroid there are always some <div>-tags in it. Why? They don't need to be there. I kill them eveytime I see them, but it is a lot of work.
But if they are there, they sometimes destroy my layout of the card. So I need to remove them.
And it is hard to re-edit the card with AnkiDroid while there are some tags in them.

exsudat82

unread,
Mar 7, 2013, 2:42:02 AM3/7/13
to anki-a...@googlegroups.com
Does noone has a problem like me?
Am I the onlyone with div-tags in my fields?

Flavio Lerda

unread,
Mar 7, 2013, 5:24:54 AM3/7/13
to anki-a...@googlegroups.com
Hello,

Is this in the card editor?
If so, this is because AnkiDroid only support plain text fields, but Anki on the Desktop uses HTML.

If this happens on the cards during review (<div> is actually shown on the cards),
check your settings to see if the simple review interface is enabled.

Flavio


On Thu, Mar 7, 2013 at 7:42 AM, exsudat82 <exsu...@gmail.com> wrote:
Does noone has a problem like me?
Am I the onlyone with div-tags in my fields?

--
You received this message because you are subscribed to the Google Groups "AnkiDroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anki-android...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Flavio Lerda

christi...@web.de

unread,
Mar 8, 2013, 7:57:19 AM3/8/13
to anki-a...@googlegroups.com
On 2013-03-07 10:24 Flavio Lerda <fle...@gmail.com> wrote:
> Is this in the card editor?

It is in the card editor of AnkiDroid.
If the card itself is shown there is no tag. But the div-tag influence
the layout of the card. There is to much space between the lines.

> If so, this is because AnkiDroid only support plain text fields, but
> Anki on the Desktop uses HTML.

I never used HTML-tags while creating the card with the Linux-Version
of Anki.

Anki 1.x handled that stuff for itself without teasing me with tags.

> If this happens on the cards during review (<div> is actually shown
> on the cards),

no it is not

Flavio Lerda

unread,
Mar 8, 2013, 8:07:55 AM3/8/13
to anki-a...@googlegroups.com
I think this is working as intended.

In Anki 2.0, the editor on the desktop is an HTML editor and it generates HTML, even if you do not see it.
If you want, you can edit cards on the desktop to see the HTML. It is in the menu near the toolbar while
editing a card, it is called "Edit HTML".

I think the <div> is inserted if you press enter. In Anki 1.x, this would insert a <br> instead.

Can you export a few cards in your deck so that I can have a look?
Maybe there is something in your CSS that causes the extra space.

Or maybe there is a discrepancy between the style on the desktop and AnkiDroid.

Flavio


--
You received this message because you are subscribed to the Google Groups "AnkiDroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anki-android...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
Flavio Lerda

christi...@web.de

unread,
Mar 10, 2013, 4:26:16 AM3/10/13
to anki-a...@googlegroups.com
On 2013-03-08 13:07 Flavio Lerda <fle...@gmail.com> wrote:
> I think the <div> is inserted if you press enter. In Anki 1.x, this
> would insert a <br> instead.

On that card I see a <br> tag in HTML-Mode with Anki2.x on Linux. The
card was created with Ank2.x.

On Anki-Droid I only see div-tags.

> Can you export a few cards in your deck so that I can have a look?
> Maybe there is something in your CSS that causes the extra space.

done.
cram1.apkg

christi...@web.de

unread,
Mar 14, 2013, 9:19:31 AM3/14/13
to anki-a...@googlegroups.com
On 2013-03-08 13:07 Flavio Lerda <fle...@gmail.com> wrote:
> Can you export a few cards in your deck so that I can have a look?
> Maybe there is something in your CSS that causes the extra space.

Please look at this little bit more complex deck, too.
It is very interesting that only the 1th and the 3rd field are affected
with tags, when you edit them with AnkiDroid.
Editing them with Anki (Linux) no tags are displayed.
The deck was created with the Linux version.
cram1.apkg

christi...@web.de

unread,
Mar 26, 2013, 2:08:48 AM3/26/13
to anki-a...@googlegroups.com
On 2013-03-08 13:07 Flavio Lerda <fle...@gmail.com> wrote:
> Can you export a few cards in your deck so that I can have a look?
> Maybe there is something in your CSS that causes the extra space.

Hi Flavio,

did you found something helpfull in my exported deck?

Flavio Lerda

unread,
Mar 28, 2013, 9:48:08 AM3/28/13
to anki-a...@googlegroups.com
Hello,

I have looked at both the decks but everything is working fine for me.
I am using the released version of AnkiDroid (2.0.1) and editing the fields
works as expected. I attached screenshots to understand if this is not
what you are seeing.

Basically, in the editor I see the <div>, but that's expected.
If I edit the fields, things seem to work fine for me afterwards.

I think AnkiDroid will include <br> instead of <div>, as that is what
the behavior was under Anki 1. Is the probably that there is an extra
empty like if you add newlines in the field after a </div>?

-Flavio


--
You received this message because you are subscribed to the Google Groups "AnkiDroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anki-android...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
Flavio Lerda
Screenshot_2013-03-28-13-30-30.png
Screenshot_2013-03-28-13-31-07.png
Screenshot_2013-03-28-13-32-16.png
Screenshot_2013-03-28-13-34-25.png
Screenshot_2013-03-28-13-34-28.png
Screenshot_2013-03-28-13-34-45.png
Screenshot_2013-03-28-13-34-52.png
Screenshot_2013-03-28-13-35-09.png

christi...@web.de

unread,
Mar 29, 2013, 3:50:46 AM3/29/13
to anki-a...@googlegroups.com
> Basically, in the editor I see the <div>, but that's expected.
> If I edit the fields, things seem to work fine for me afterwards.

Yeah it looks like on my machine.

But you "expect" that there are div-tags in the third field but not in
the other ones?

It is not an defined behaviour of the developer I think. It is a bug.

And I have never seen <br>-tags like this in the 1.x Versions. Of
course Anki 1.x used br but never showed them to me.

If I remove the div-tags the Layout changes a bit. And that is what I
want. No div-tags in there. Or hide them from me.

Flavio Lerda

unread,
Mar 29, 2013, 8:15:35 AM3/29/13
to anki-a...@googlegroups.com
Hello Christian,

Currently AnkiDroid only has a plain text editor, not an HTML editor.
That is why we show the div tags. Of course it would be great to
have such an editor implemented, but that's not currently supported.

If you remove the div tags, then you are actually changing the format
of your fields, which will affect the resulting cards.

I filed a enhancement request to implement an HTML editor, but it is actually
something that is non-trivial, so it will probably take quite some time.

Thanks for your feedback,
Flavio


--
You received this message because you are subscribed to the Google Groups "AnkiDroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anki-android...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
Flavio Lerda

christi...@web.de

unread,
Mar 31, 2013, 8:07:44 AM3/31/13
to anki-a...@googlegroups.com
On 2013-03-29 12:15 Flavio Lerda <fle...@gmail.com> wrote:
> Currently AnkiDroid only has a plain text editor, not an HTML editor.
> That is why we show the div tags.

But the div tags only in the 1th and 3thrd field. I have notes with 5
fields. What you are describeing is inconsistent! It is a bug.
Depending on your describtion of the behaviour the should be div tagsin
ALL fields. But it isn't as you can see in my example.

> Of course it would be great to
> have such an editor implemented, but that's not currently supported.

What is about AnkiDroid1.x? I have never seen html-tags there. Was the
complete 1.x code dumped? There is such an editor in the 1.x.

btw: What is about the developer of Anki? Didn't he read this list and
can give his opionen about that topic to it?
--
http://www.stitches4you.de

Flavio Lerda

unread,
Mar 31, 2013, 10:03:38 AM3/31/13
to anki-a...@googlegroups.com
Hello Christian,
 
> Currently AnkiDroid only has a plain text editor, not an HTML editor.
> That is why we show the div tags.

But the div tags only in the 1th and 3thrd field. I have notes with 5
fields. What you are describeing is inconsistent! It is a bug.
Depending on your describtion of the behaviour the should be div tagsin
ALL fields. But it isn't as you can see in my example.

The <div> tags are only added when there is text on multiple lines.
In the other fields the text contains a single line, so there is no need for
the <div> tags.

This is because HTML ignores newlines in the text, so one needs to
add either <br>, <div> or some other type of tags to make the HTML
show a newline.

Therefore, the fact that there are <div> tags in only some of the fields
is also expected.
 

> Of course it would be great to
> have such an editor implemented, but that's not currently supported.

What is about AnkiDroid1.x? I have never seen html-tags there. Was the
complete 1.x code dumped? There is such an editor in the 1.x.

AnkiDroid 1 does show HTML tags as well, for instance for bold or italic
text. However, since Anki 1 used <br> tags for newlines and there is
1-to-1 correspondence between the two, AnkiDroid replaces the <br>
with newlines. However, with <div> tags this correspondence is not the
same and replacing <div> tags with newline arbitrarily might actually
lose some of the formatting.

Anki 2 is much more focused around HTML and CSS than Anki 1 and
provides a way to directly edit the HTML. Therefore, I think having an
HTML editor in AnkiDroid 2 is a better, longer-term way to approach
the problem, even if it might require more work. It might be possible to
also come up with a workaround for the particular kinds of <div> tags
that correspond to newlines in Anki 2, but I am not sure if that's going
to provide substantial benefit.

btw: What is about the developer of Anki? Didn't he read this list and
can give his opionen about that topic to it?

I know Damien (the developer of Anki) does read this mailing list but he
only comments on some of the topics. Of course I would be happy to
hear what his opinion is on the subject. But he might be currently busy;
I think he mentioned that on the main Anki forum.

Flavio
Screenshot_2013-03-31-14-48-12.png

Damien Elmes

unread,
Apr 1, 2013, 9:31:58 AM4/1/13
to anki-a...@googlegroups.com
Ideally Anki would use <br>s instead of <div>s as they're easier for mobile clients to convert into newlines. The divs are generated by WebKit, and it's not trivial to convert them to something else. If the mobile clients are given in a WYSIWYG editor in the future, this issue should go away.

abel....@gmail.com

unread,
Feb 14, 2015, 6:11:53 AM2/14/15
to anki-a...@googlegroups.com
This may be a little late, but hitting shift+enter instead of enter only produces a new line, without div tags.

bobby.b...@gmail.com

unread,
Feb 5, 2017, 4:28:56 PM2/5/17
to AnkiDroid
Thanks for the info in this post, including the late reply which helped me. 

I was able to search and replace using Anki desktop --- replace <div> with <br> then replace </div> with nothing (leave replacement field blank). This gave me some extra linebreaks but going through anki desktop and deleting extra line breaks was much faster than going through AnkiDroid and deleting <div> tags. Shift+Enter in AnkiDesktop will insert <br> instead of <div></div> which AnkiDroid seems to understand better. 
Reply all
Reply to author
Forward
0 new messages