This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 16 - Pages: 2 [ 1 2 | Next ] - Last Post: 4 Jan 23, 21:01 Last Post By: fstromberg Threads: [ Previous | Next ]
fstromberg

Posts: 10
Registered: 22-Dec-2022
strange behavior for html comment formatting
Posted: 3 Jan 23, 23:46
 
  Click to reply to this thread Reply
Attachment 02_output_ok.png (348.1 KB)
Attachment 02.png (50.2 KB)
Attachment 01.png (52.2 KB)
Attachment 01_output_not_ok.png (348.9 KB)
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
JeffTucker

Posts: 7,937
Registered: 31-Jan-2006
Re: strange behavior for html comment formatting
Posted: 4 Jan 23, 00:02   in response to: fstromberg in response to: fstromberg
 
  Click to reply to this thread Reply
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.
JeffTucker

Posts: 7,937
Registered: 31-Jan-2006
Re: strange behavior for html comment formatting
Posted: 4 Jan 23, 00:08   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Attachment ss010621.png (10.1 KB)
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.
JeffTucker

Posts: 7,937
Registered: 31-Jan-2006
Re: strange behavior for html comment formatting
Posted: 4 Jan 23, 00:09   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Attachment ss010622.png (172.9 KB)
The result - screenshot.
fstromberg

Posts: 10
Registered: 22-Dec-2022
Re: strange behavior for html comment formatting
Posted: 4 Jan 23, 10:00   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
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
Laza

Posts: 1,527
Registered: 6-Sep-2005
Re: strange behavior for html comment formatting
Posted: 4 Jan 23, 10:16   in response to: fstromberg in response to: fstromberg
 
  Click to reply to this thread Reply
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.
Laza

Posts: 1,527
Registered: 6-Sep-2005
Re: strange behavior for html comment formatting
Posted: 4 Jan 23, 10:17   in response to: fstromberg in response to: fstromberg
 
  Click to reply to this thread Reply
Can you please tell me which CSS rules are you referring to, and where you put them?
JeffTucker

Posts: 7,937
Registered: 31-Jan-2006
Re: strange behavior for html comment formatting
Posted: 4 Jan 23, 12:21   in response to: fstromberg in response to: fstromberg
 
  Click to reply to this thread Reply
fstromberg wrote:
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.
JeffTucker

Posts: 7,937
Registered: 31-Jan-2006
Re: strange behavior for html comment formatting
Posted: 4 Jan 23, 12:25   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Laza wrote:
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?
Laza

Posts: 1,527
Registered: 6-Sep-2005
Re: strange behavior for html comment formatting
Posted: 4 Jan 23, 18:59   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
I wasn't aware of this CSS feature yet. Thanks! At the time I made this commentShort variable, there was nothing similar yet.
fstromberg

Posts: 10
Registered: 22-Dec-2022
Re: strange behavior for html comment formatting
Posted: 4 Jan 23, 19:26   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Changing ${commentShort} to ${comment} doesn't seem to work.
JeffTucker

Posts: 7,937
Registered: 31-Jan-2006
Re: strange behavior for html comment formatting
Posted: 4 Jan 23, 19:35   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Attachment clamped.png (134.7 KB)
Attachment unclamped.png (136.2 KB)
Laza wrote:
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.
fstromberg

Posts: 10
Registered: 22-Dec-2022
Re: strange behavior for html comment formatting
Posted: 4 Jan 23, 19:44   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
Laza wrote:
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

JeffTucker

Posts: 7,937
Registered: 31-Jan-2006
Re: strange behavior for html comment formatting
Posted: 4 Jan 23, 19:49   in response to: fstromberg in response to: fstromberg
 
  Click to reply to this thread Reply
Attachment ss010625.png (29.7 KB)
fstromberg wrote:
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.
fstromberg

Posts: 10
Registered: 22-Dec-2022
Re: strange behavior for html comment formatting
Posted: 4 Jan 23, 20:02   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:

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

Point your RSS reader here for a feed of the latest messages in all forums