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


Permlink Replies: 9 - Pages: 1 - Last Post: 02-May-2019 12:48 Last Post By: jGromit
MarkusD

Posts: 471
Registered: 13-Apr-2006
Title text broken for folders
Posted: 30-Apr-2019 18:53
 
  Click to reply to this thread Reply
Hi,

please have a look here.

The text under the thumb with the temperature gauge is kind of broken. This is the result with JA 18.2.1 and Tiger Version 2.5.3

To make sure that this is not my fault I installed JA 18.0.1 and Tiger Version 2.4.4 and compiled again, and with this older package everything is fine again, see here.

The text of the title is:
26.01.2019 Hahnst&auml;tten &ndash; <i class="fa fa-ship"> </i>&ndash; Malm&ouml;


Please take attention that in the above code I use:
'fa fa-ship'
not:
"'fa fa-ship" as it seems.

The text of the comment is:
<h4 class="myComments">Sa 26.01.2019 Hahnst&auml;tten &ndash; Puttgarden &ndash; [DANMARK] &ndash; R&oslash;dby &ndash; &Ouml;resundbr&uuml;cke &ndash; [SVERIGE] &ndash; Malm&ouml;, &sbquo;First Hotel J&ouml;rgen Kock&lsquo;, 9 Std. 14 Min. (867 km) <a href="https://goo.gl/maps/M3VjhHq3Gvy" target="_blank" class="mylink" rel="nofollow">Karte</a></h4>


The above code worked fine for quite some time. I assume that JA or tiger with a recent update changed something.

I'm not sure if this is a bug, of either JA or Tiger or if still my code is wrong.

I attached my project file.

In January I had some trouble regarding the above code, see here. But with the help of jGromit I was able to fix the problem.

Any idea what is going wrong here? Thanks in advance, Markus
jGromit

Posts: 7,543
Registered: 31-Jan-2006
Re: Title text broken for folders
Posted: 30-Apr-2019 20:47   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
This is a Tiger bug, so I'll move this thread.

Laza, ignore all of MarkusD's byzantine coding and variations. The problem is simpler than that. If you choose Tiger > Site > Site admin > Use ALT tags for search engines, you get a broken folder title display. The DOM:
<img class="show-image" src="thumbs/folder/Folder_ARP273.jpg" alt=" alt="A title"">
If the title is simple, the error doesn't actually break the page, but if the title has anything fancy in it, like an HTML tag, you're in no-man's land.

I think for any alt or title attribute, you also have to strip out all HTML tags, since they're fundamentally incompatible with those attributes. It may also be necessary to do some replacing or escaping of double-quote marks.
Laza

Posts: 2,173
Registered: 6-Sep-2005
Re: Title text broken for folders
Posted: 01-May-2019 07:38   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
The whole code relies on simple text in Titles, it's only the comment which is HTML-enabled.
MarkusD

Posts: 471
Registered: 13-Apr-2006
Re: Title text broken for folders
Posted: 01-May-2019 09:10   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Laza wrote:
The whole code relies on simple text in Titles, it's only the comment which is HTML-enabled.
That means using HTML-code in titles is of no good, if I also use Tiger > Site > Site admin > Use ALT tags for search engines ? Because, yes it is true I recently activated this option and my problems don't have anything to do with an update of JA nor Tiger.

I switched off Use ALT tags for search engines and everything is fine again, with my „byzantine coding and variations“. ;-)

I can live with the fact to not use the option Use ALT tags for search engines. I just played with it. Thanks for you help, Markus
Laza

Posts: 2,173
Registered: 6-Sep-2005
Re: Title text broken for folders
Posted: 01-May-2019 09:27   in response to: MarkusD in response to: MarkusD
 
  Click to reply to this thread Reply
Naturally, if this is the only place the HTML tags break the code, I can add a filter for ALT tags. I'm not sure though, as titles were always treated as plain text.
jGromit

Posts: 7,543
Registered: 31-Jan-2006
Re: Title text broken for folders
Posted: 01-May-2019 12:11   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Laza wrote:
The whole code relies on simple text in Titles, it's only the comment which is HTML-enabled.

Please look at the resulting code, which I have posted above. It's invalid HTML. It produces "red text" when the page code is viewed in Firefox. It fails any validator. This is what it's producing:

alt=" alt="A title""

ETA: The code is broken whether there are HTML tags in the title or not. The code is broken with just simple text.

Having HTML tags in alt or title is a secondary issue. Having them present doesn't normally "break" anything, but filtering them out just cleans up the code, and, in the case of a title attribute, improves the appearance of the tooltip.
Laza

Posts: 2,173
Registered: 6-Sep-2005
Re: Title text broken for folders
Posted: 02-May-2019 08:43   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
I can't find where it gets into the page code. I can't reproduce this error either.
jGromit

Posts: 7,543
Registered: 31-Jan-2006
Re: Title text broken for folders
Posted: 02-May-2019 12:09   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Attachment altTag.zip (1.7 MB)
Here's a zipped-up project that shows the error (still present in 2.5.4). It occurs if you put a title on a folder, and also tell Tiger to add alt tags for SEO.
Laza

Posts: 2,173
Registered: 6-Sep-2005
Re: Title text broken for folders
Posted: 02-May-2019 12:44   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
I have no idea how could I miss this... 8-|
jGromit

Posts: 7,543
Registered: 31-Jan-2006
Re: Title text broken for folders
Posted: 02-May-2019 12:48   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Well, with a normal text title, it doesn't actually break the page - the invalid HTML gets flagged by the browser (red in Firefox source code), but there's no visible problem. And it's just on folder titles - image titles are OK. So, easy to miss.

It was only when someone's folder title also included HTML tags that the effects got ugly enough to be visible. Took me a while to hunt it down because of all the red herrings.
Legend
Forum admins
Helpful Answer
Correct Answer

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