when you add tags an extra space after the comma is created which means more tags!

TalkBug Collectors

Join LibraryThing to post.

when you add tags an extra space after the comma is created which means more tags!

This topic is currently marked as "dormant"—the last message is more than 90 days old. You can revive it by posting a reply.

1Bettesbooks
Mar 10, 2020, 4:07 pm

when you create tags when adding books and then save - there are extra spaces added and a lot of new tags are created.

For example
https://www.librarything.com/work/11025539

these are the tags exactly as entered:
*KU free series, *overdrive, ti-f, au-m, zzUS Washington, mystery, cozy mystery, 2018, zseries of(3)

check it out - here is how it appears when saved:
*KU free series, *overdrive, ti-f, au-m, zzUS Washington, mystery, cozy mystery, 2018, zseries of(3)

I must go correct that leading space or a new tag is created (which I don't need).

The new tags are listed at the end of All tags on my home page.

2norabelle414
Mar 10, 2020, 4:10 pm

Whoops sorry, I commented on your other thread -

https://www.librarything.com/work/11025539/book/162964584

I do indeed see extra spaces before tags on that page for your book, but I've never seen it on my own books.

What page are you on when you add the tags?

3lorax
Mar 10, 2020, 4:29 pm

Link to the "other thread" norabelle414 mentioned:

https://www.librarything.com/topic/317562

Like norabelle414 mentioned in #2, I've never had this happen either, and I do see it on the linked book page. (HTML eats the extra spaces in Talk which is why the two lists in Bettesbooks #1 look identical.)

4Bettesbooks
Mar 10, 2020, 5:36 pm

>3 lorax:
It is happening in two places:

1. The big Add Books tab - I search by ASIN and then edit. The tag field is empty before I add my string of tags.

2. Or when I edit from your books list. Where I make edits when I read books, add reviews etc.

I caught the extra spaces simply because my tag count had gone up so astronomically and when I entered a tag the drop down provided more than one choice.

It wasn't until I did ALL TAGS and ALL COLLECTIONS from my home page that I saw them listed at the very end of all previous tags.

I use Windows 10 Edge.

I have added a tag field to my spreadsheet so I won't need to type free-hand. But, I must take out all spaces or those little extra spaces after the comma occur!

5lorax
Mar 11, 2020, 10:48 am

I have added a tag field to my spreadsheet so I won't need to type free-hand. But, I must take out all spaces or those little extra spaces after the comma occur!

So you're cutting and pasting a string from another source, and that string has spaces in it?

OF COURSE there will be spaces in the tags generated by this method! Computers are very stupid and do exactly what you tell them to. So if you tell it to add a list of tags that is

one, two, three

it will do EXACTLY that. It will add (now using quotes so the spaces will show up)

"one" " two" " three"

since it's too stupid to know that humans use spaces in a comma-separated list for readability, and that what you really WANT is

"one" "two" "three" - it thinks if you wanted that you would have asked it to add

one,two,three

It would be trivial on LT's end to strip off leading and/or trailing whitespace - they probably haven't done this in case someone, somewhere, wants it. Just ask it to add the tags you actually want it to add, and it will be fine.

6timspalding
Mar 11, 2020, 10:53 am

Okay, working on this.

7timspalding
Mar 11, 2020, 11:51 am

I can't get this to happen anywhere. Lorax is probably right that there's somewhere it's not being stripped. I'd also consider that the space isn't a normal space, but one of the various not-quite-spaces in unicode.

Either way, can I get a more precise description of what you are doing to get this. What page are you editing on?

8timspalding
Mar 11, 2020, 12:02 pm

Got it. Your tag contains a non-breaking space (Unicode U+00A0 : NO-BREAK SPACE NBSP). You must be grabbing it from somewhere that's adding it.

Ideally, I'd go through the code to prevent this everywhere, along with a number of other oddballs—the Mongolian vowel separator, etc. But the problem is limited enough, and the job would be large enough, that I don't think I can justify the time at present.

9Bettesbooks
Mar 11, 2020, 5:43 pm

>5 lorax:, the cutting and pasting is my way of correcting the problem that was happening when I was typing directly into LT. But thanks for your input.

10timspalding
Mar 11, 2020, 6:09 pm

>9 Bettesbooks:

If you're just typing directly into LT, I don't see how non-breaking spaces are being generated. Non-breaking spaces can't generally be typed!

11Bettesbooks
Mar 12, 2020, 3:34 am

>10 timspalding: What can I say? I was typing directly into LT. Everything was fine for 3 years the this.
But I did download Libby (overdrive was making some changes to webpages and search had disappeared, but it is back now_ and it was affecting other websites so I uninstalled today, maybe that will help!

12lorax
Mar 12, 2020, 9:25 am

Also, if this problem was appearing for "normal" tag entry and it's not due to something exceptionally weird about your setup, other people would be having the same problem.

13flying_monkeys
Edited: Mar 12, 2020, 10:13 am

It's been happening for me too -- the extra spaces. I just didn't think it was something I should report. All I do is double click inside the Tags field, start typing a tag, for instance, graphic novels, when I get to the a in graphic, I stop typing, arrow down to graphic novels and hit return. When the tag fills the Tags field, there is an automatic space before the g in graphic and a space after the comma. I've been manually deleting the space before and after.

ETA: Here, I left one as-is for your review https://www.librarything.com/work/23857507/details/179292994

Screenshots

https://pasteboard.co/IYL85zS.png

https://pasteboard.co/IYL8qvG.png

14timspalding
Mar 12, 2020, 11:06 am

>13 flying_monkeys:

The g in graphic does not have a space before it. You can tell by clicking on the tag.

15timspalding
Mar 12, 2020, 11:07 am

>13 flying_monkeys:

What's your browser/OS now?

16Bettesbooks
Edited: Mar 12, 2020, 1:42 pm

>12 lorax:
I refer you to >13 flying_monkeys:.

Many of us don't report issues, we work around them because they are hard to describe; or, fear of being denigrated for lack of technical knowledge; or, fear of simply being dismissed.

I only reported this issue because of the number of tags being created and as a responsible LT citizen I was concerned about data storage.

17Bettesbooks
Edited: Mar 12, 2020, 1:35 pm

Tim, another issue with editing tags is you can't click on drop down menu option unless it is end of string, if you click on it at beginning or in the middle it will overwrite until the end of the option.

for example here is what I have had happen
1. ti-a, au-m, mystery (this is orig tag string)

I want to add K free to beginning of stream
2. K free, -m, mystery (edited tag stream if from drop down)

18timspalding
Mar 12, 2020, 1:29 pm

>17 Bettesbooks:

What browser are you on?

19norabelle414
Mar 12, 2020, 1:38 pm

>17 Bettesbooks: You can tags to the beginning of a list using the drop down, you just have to add a comma before the first tag first, so the system knows you're trying to add a new tag and not just edit the first tag.

20Bettesbooks
Mar 12, 2020, 1:41 pm

>17 Bettesbooks:
Microsoft Edge is up to date.
Version 80.0.361.66 (Official build) (64-bit)

21Bettesbooks
Mar 12, 2020, 1:59 pm

>19 norabelle414: Thank you that is an excellent workaround I also tested it in the middle of the tag string and as long as I put a comma before where I wanted to insert the drop down option it worked, without the comma before it would overwrite

ex
1. ti-a, au-m, zzUS Washington, mystery, cozy mystery, short story, crime, 2015, zseries of(6) (orig string)
result ended up with leading space! that I then deleted.
*K pay series,ti-a, au-m, zzUS Washington, mystery, crime, cozy mystery, short story, 2015, zseries of(6)

2.adding word crime before cozy with space(,) added to beginning of cozy
*K pay series, ti-a, au-m, zzUS Washington, mystery, crime,cozy mystery, short story, crime, 2015, zseries of(6) (works but same key strokes I think it would be easier to type in entire tag)

3. what happened when I didn't add space(,) prior to inserting drop down option
*K pay series, ti-a, au-m, zzUS Washington, mystery, crime, short story, 2015, zseries of(6) as you can see it overwrote cozy mystery.

22aspirit
Mar 12, 2020, 2:51 pm

Is this the same problem as described in Automatic adding of spaces not helpful (open report, dormant)?

23Bettesbooks
Mar 12, 2020, 3:13 pm

>22 aspirit:, Sorry I don't know - I didn't go back that far to catch that posting and it was before my time here on LT.

I haven't read thru all the posts, and right of the moment I don't have the time. But, I will try to get to tonight.

24aspirit
Mar 12, 2020, 4:07 pm

>23 Bettesbooks: I saw the old thread while trying (and failing) to find a specific conversation about extra spaces when adding books. This thread but not that one without a clear explanation, so I was wondering if the issues are the same.

25flying_monkeys
Edited: Mar 12, 2020, 4:41 pm

>15 timspalding:

I'm on Chrome Version 80.0.3987.132 (Official Build) (64-bit)

Windows 10 Home Version 10.0.18363 Build 18363

ETA: I tested and it *does* have the space after saving (double-clicking inside I saw it) *until* the page reloads. I hadn't ever gone back in to test with a page refresh to see if the space was automatically removed. But it is there upon tag selection and immediately after saving. Now it appears like it may be correcting itself after you leave then revisit the tag/page.

26AnnieMod
Mar 12, 2020, 4:56 pm

>25 flying_monkeys:

This had always worked like that for me on Chrome - it has a visual space (basically an "after the comma" one) but it is not part of the tag itself.