A "space" bug? Wha..? ๐Ÿคจ | Sololearn: Learn to code for FREE!
Nowy kurs! Kaลผdy programista powinien nauczyฤ‡ siฤ™ Generative AI!
Wyprรณbuj darmowฤ… lekcjฤ™
+ 5

A "space" bug? Wha..? ๐Ÿคจ

Can anyone tell me anything about this? I was trying to help James McLain out to figure out why his simple test code was not working. After staring at it for a good while and then writing my own code lines, which looked identical to his, I still did not see anything wrong. They matched character for character. My line worked, his line did not... yet they were identical except for using a different div ID. I switched the div IDs and yet still my line worked but his line did not. After that I started playing with his line, erasing parts of it and retyping them and then suddenly it worked. After a bit more trial and error, I found out what it was: a... space ๐Ÿคจ. For some reason it does not like the space between "image: linear" in the CSS. If you erase that space, and then put it back again... It works fine. Here is a saved copy of his code to see for yourselves. I replaced "peach" with "red" as CSS doesn't seem to like "peach": https://code.sololearn.com/WR8W0U33azs1/?ref=app

3rd Apr 2019, 3:28 PM
Decimis โ€  ๐•ฏ๐–Š๐–ˆ๐–Ž๐–’๐–Ž๐–˜
Decimis โ€  ๐•ฏ๐–Š๐–ˆ๐–Ž๐–’๐–Ž๐–˜ - avatar
11 odpowiedzi
+ 8
What looks like a space is an invisible character. This can happen when you copy code from your ide or a text editor into the codeplayground.
3rd Apr 2019, 3:38 PM
Denise RoรŸberg
Denise RoรŸberg - avatar
+ 8
Schilling Attila The other white space characters such as tab, space, line break, and/or carriage return aren't actually related to this problem. The use of white space for readable formatting also is unrelated to this issue and certainly won't cause a stack error in CSS. The bonus about "editors not saving you from messing up the basics" and the explanation was entirely unclear and seemed to be convoluting different scenarios and different types of issues altogether. I struggled following your points. I'm only pointing this out so others who read this aren't confused by any of the possible interpretations from your answer.
5th Apr 2019, 3:54 PM
David Carroll
David Carroll - avatar
+ 7
Here you see an example with the error message: https://code.sololearn.com/cfj27oJABRuo/?ref=app Edit: Normally you get only compilation error. So it is a bit tricky to find the bug.
3rd Apr 2019, 3:40 PM
Denise RoรŸberg
Denise RoรŸberg - avatar
+ 7
Decimis โ€  ๐•ฏ๐–Š๐–ˆ๐–Ž๐–’๐–Ž๐–˜ Not really. Maybe some ide's shows you this character or the line. If I'm right it has to do with utf-8 encoding. Here is another thread. One member found the lines: https://www.sololearn.com/discuss/1731911/?ref=app
3rd Apr 2019, 5:50 PM
Denise RoรŸberg
Denise RoรŸberg - avatar
+ 6
Decimis โ€  ๐•ฏ๐–Š๐–ˆ๐–Ž๐–’๐–Ž๐–˜ About viewing invisible characters, you can if your code editor comes with multiple encoding support, just switch the encoding to ANSI or ASCII (some editors treat these similarly). By then those invisible characters will show up ๐Ÿ‘
4th Apr 2019, 5:45 AM
Ipang
+ 5
Denise RoรŸberg 1Loryโ˜• So I just opened up Sololearn on a PC for the first time and to my surprise in the playground, it showed the "invisible character" on my copy of James McLain 's code...It came up as a red box with a dot or dash in it ๐Ÿคจ BTW Sololearn really needs to update their desktop version. It is really lacking compared to the app ๐Ÿ˜ฃ
3rd Apr 2019, 9:01 PM
Decimis โ€  ๐•ฏ๐–Š๐–ˆ๐–Ž๐–’๐–Ž๐–˜
Decimis โ€  ๐•ฏ๐–Š๐–ˆ๐–Ž๐–’๐–Ž๐–˜ - avatar
+ 3
Denise RoรŸberg Thanks for the link ๐Ÿ‘ So it's not an unknown issue then ๐Ÿค”
3rd Apr 2019, 6:53 PM
Decimis โ€  ๐•ฏ๐–Š๐–ˆ๐–Ž๐–’๐–Ž๐–˜
Decimis โ€  ๐•ฏ๐–Š๐–ˆ๐–Ž๐–’๐–Ž๐–˜ - avatar
+ 3
Use code editor or html formater. Com
5th Apr 2019, 9:38 AM
Gordon
Gordon - avatar
+ 1
Denise RoรŸberg Hmm interesting ๐Ÿค” Is there anyway, that you know of, to see this "invisible character" or to tell what it is coming up as? This took enough time as it was trying to find it on a few lines of code, I imagine it could be quite the challenge to find an "invisible character" on a transferred code with many lines if it caused the entire thing not to run ๐Ÿ˜ฅ
3rd Apr 2019, 4:20 PM
Decimis โ€  ๐•ฏ๐–Š๐–ˆ๐–Ž๐–’๐–Ž๐–˜
Decimis โ€  ๐•ฏ๐–Š๐–ˆ๐–Ž๐–’๐–Ž๐–˜ - avatar
+ 1
James McLain Was your orginal code typed up here on Sololearn or did you transfer it in?
3rd Apr 2019, 4:23 PM
Decimis โ€  ๐•ฏ๐–Š๐–ˆ๐–Ž๐–’๐–Ž๐–˜
Decimis โ€  ๐•ฏ๐–Š๐–ˆ๐–Ž๐–’๐–Ž๐–˜ - avatar
0
It's Cuse of the reason In css u can use tab to get some space...or space but not both especially not in the same line plus line breaks are important to being organised properly if u do not folow these basics regardless ur content it will stack error. Additional bonus whatever editor u use it won't save u from mess up the basics.The explaination is that when the code run through the framework of its for u looks one space left but made different buttons or method with then it's a differ character in the background there is difference beetwin space and space...๐Ÿ˜€
5th Apr 2019, 1:40 PM
Schilling Attila
Schilling Attila - avatar