Posts:
10
Registered:
22-Dec-2022
|
|
|
strange behavior for html comment formatting
Posted:
3 Jan 23, 23:46
|
|
|
|
Hi, I encountered a strange problem introducing some text into the comment section of a picture folder. The correct formatting is only executed when I include just one link. If I include two links the whole formatting is ignored by jalbum. Is there some obvious error on my side which I am not aware of? I am using the Story skin btw.
Please see attachments for the mentioned problems (code and subsequent output for the different situations.)
Edited by: fstromberg on 3 Jan 2023, 23:47
|
|
|
Posts:
7,938
Registered:
31-Jan-2006
|
|
|
Re: strange behavior for html comment formatting
Posted:
4 Jan 23, 00:02
in response to: fstromberg
|
|
|
This appears to be a Story bug - in my skins, both links work as expected. It also afflicts some other Laza skins - I'm sure that, like all skin developers, he's using the same chunk of code in multiple places.
I'll move this thread.
|
|
|
Posts:
7,938
Registered:
31-Jan-2006
|
|
|
Re: strange behavior for html comment formatting
Posted:
4 Jan 23, 00:08
in response to: JeffTucker
|
|
|
|
Another tidbit of information: if I hand-code a comment (screenshot), without all the detritus that the HTML editor introduces, things behave as expected. I suspect Laza is trying to strip out some of the excess HTML tags, and his routine ends up throwing out the baby with the bathwater.
|
|
|
Posts:
7,938
Registered:
31-Jan-2006
|
|
|
Re: strange behavior for html comment formatting
Posted:
4 Jan 23, 00:09
in response to: JeffTucker
|
|
|
|
|
|
Posts:
10
Registered:
22-Dec-2022
|
|
|
Re: strange behavior for html comment formatting
Posted:
4 Jan 23, 10:00
in response to: JeffTucker
|
|
|
How can I access the "hand coding"? I already typed the html by hand in the comment field (the results were no different than using the html editor).
Btw, it seems that there are also problems with the css. The rules I put in there are ignored or poorly executed. Maybe I will simply change the skin then and hope it works better.
Edited by: fstromberg on 4 Jan 2023, 10:00
|
|
|
Posts:
1,529
Registered:
6-Sep-2005
|
|
|
Re: strange behavior for html comment formatting
Posted:
4 Jan 23, 10:16
in response to: fstromberg
|
|
|
I guess this happens because of the template containing the ${commentShort} variable, and adding the second link just makes the comment longer than 160 chars. In this case, all the HTML tags got stripped to avoid the final text containing broken HTML tags. Just replace ${commentShort} with ${comment} in the Folder caption template.
|
|
|
Posts:
1,529
Registered:
6-Sep-2005
|
|
|
Re: strange behavior for html comment formatting
Posted:
4 Jan 23, 10:17
in response to: fstromberg
|
|
|
Can you please tell me which CSS rules are you referring to, and where you put them?
|
|
|
Posts:
7,938
Registered:
31-Jan-2006
|
|
|
Re: strange behavior for html comment formatting
Posted:
4 Jan 23, 12:21
in response to: fstromberg
|
|
|
How can I access the "hand coding"?
Just don't use the HTML editor. I avoid it, because it's inclined to do me "favors," like inserting <p> tags, which produce double line feeds on the page, rather than simple <br> tags. You can enter your code directly under the thumbnail, or open the image for editing and use the larger, expandable box below the image.
|
|
|
Posts:
7,938
Registered:
31-Jan-2006
|
|
|
Re: strange behavior for html comment formatting
Posted:
4 Jan 23, 12:25
in response to: Laza
|
|
|
I guess this happens because of the template containing the ${commentShort} variable, and adding the second link just makes the comment longer than 160 chars. In this case, all the HTML tags got stripped to avoid the final text containing broken HTML tags.
Instead of an arbitrary 160 characters, would -webkit-line-clamp be more forgiving?
|
|
|
Posts:
1,529
Registered:
6-Sep-2005
|
|
|
Re: strange behavior for html comment formatting
Posted:
4 Jan 23, 18:59
in response to: JeffTucker
|
|
|
I wasn't aware of this CSS feature yet. Thanks! At the time I made this commentShort variable, there was nothing similar yet.
|
|
|
Posts:
10
Registered:
22-Dec-2022
|
|
|
Re: strange behavior for html comment formatting
Posted:
4 Jan 23, 19:26
in response to: Laza
|
|
|
Changing ${commentShort} to ${comment} doesn't seem to work.
|
|
|
Posts:
7,938
Registered:
31-Jan-2006
|
|
|
Re: strange behavior for html comment formatting
Posted:
4 Jan 23, 19:35
in response to: Laza
|
|
|
|
I wasn't aware of this CSS feature yet. Thanks! At the time I made this commentShort variable, there was nothing similar yet.
It's been in the draft specs for a long time, and still is available only with a -webkit prefix, though it works in all browsers. Why they don't just all support line-clamp without the prefix, I don't know. And it requires a lot of excess nonsense: .ja-foldertitle, .ja-foldercomment {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
But it's very flexible, since it kicks in at page display time. And it seems to be able to handle things like embedded links - see screenshots.
|
|
|
Posts:
10
Registered:
22-Dec-2022
|
|
|
Re: strange behavior for html comment formatting
Posted:
4 Jan 23, 19:44
in response to: JeffTucker
|
|
|
I wasn't aware of this CSS feature yet. Thanks! At the time I made this commentShort variable, there was nothing similar yet.
It's been in the draft specs for a long time, and still is available only with a -webkit prefix, though it works in all browsers. Why they don't just all support line-clamp without the prefix, I don't know. And it requires a lot of excess nonsense: .ja-foldertitle, .ja-foldercomment {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
But it's very flexible, since it kicks in at page display time. And it seems to be able to handle things like embedded links - see screenshots.
Is it something I can apply since the other stuff doesn't seem to work? And if yes, where do I put the code?
Edited by: fstromberg on 4 Jan 2023, 19:45
|
|
|
Posts:
7,938
Registered:
31-Jan-2006
|
|
|
Re: strange behavior for html comment formatting
Posted:
4 Jan 23, 19:49
in response to: fstromberg
|
|
|
|
Is it something I can apply since the other stuff doesn't seem to work? And if yes, where do I put the code?
Just tested in Story, and if you use ${comment} for the folder caption, it behaves itself. Make sure you're changing the right thing - see screenshot.
|
|
|
Posts:
10
Registered:
22-Dec-2022
|
|
|
Re: strange behavior for html comment formatting
Posted:
4 Jan 23, 20:02
in response to: JeffTucker
|
|
|
Just tested in Story, and if you use ${comment} for the folder caption, it behaves itself. Make sure you're changing the right thing - see screenshot.
Oh yes, now it works. I changed it in the "images" section. Too much possibilities  .
Edited by: fstromberg on 4 Jan 2023, 20:02
|
|
|
|
Legend
|
|
Forum admins
|
|
Helpful Answer
|
|
Correct Answer
|
|