Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-06-07 07:11:30

Wolfgang
Member
From: Germany
Registered: 2006-07-18
Posts: 71
Website

"-Characters are missinterpreted in the alt-tags of graphics ...

Hello

Up to now I do not know, if it is a missing feature or an error. The following Problem occurs

a: I have uploaded a picture and inserted an alt text.
b) This alt text contains some characters like “
c) If I insert this characters from keyboard directly then this character will occur as a delimiter of the alt text.

I write: >This “Picture” should be red<
And follwing occurs: <img src=”…” alt=“This “ Picture=”“ ,=”“ should=”“ be=”“ red=”“>

Of course, it works well, If I Insert &quot instead of this.

My feeling ist: At least there schould be a warning message, but normally the character should be replaced.

Best regards
Wolfgang

Offline

#2 2008-06-07 08:48:15

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: "-Characters are missinterpreted in the alt-tags of graphics ...

With most of the image-related tags like <txp:image />, <txp:article_image />, escape="html" does what you are trying to achieve, I assume.

Offline

#3 2008-06-08 10:35:32

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: "-Characters are missinterpreted in the alt-tags of graphics ...

I think escape=html should be the default.

Offline

#4 2008-06-08 11:39:49

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: "-Characters are missinterpreted in the alt-tags of graphics ...

Me, too, for ages. Anyone else? Would we care about b/c?

Offline

#5 2008-06-08 19:26:01

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: "-Characters are missinterpreted in the alt-tags of graphics ...

Someone needs to explain what this does and what is different to the current default please.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#6 2008-06-08 19:38:00

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: "-Characters are missinterpreted in the alt-tags of graphics ...

In case you use quotes, less-than or greater-than signs in an image’s alt or description attribute and output said image with <txp:image /> or <txp:artice_image />, all characters are output as-is, even those which actually had to be escaped when used in a HTML document (&quot; et al.). This escapement is switched off by default, so if one happens to enter an image tag without adding the escape="html" attribute, it might cause havoc.

The escape attribute was introduced in Txp 4.0.4, I think, so we’d have to consider backwards compatibility (b/c) if we changed the default behaviour in 4.0.7. No big deal, IMHO, but there might be edge cases.

Offline

#7 2008-06-09 15:53:48

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: "-Characters are missinterpreted in the alt-tags of graphics ...

So it’s down to b/c is it? Well first let me say that I have never used or knew about the “escape” attribute. Having just read the explanation of it over on Textbook I would be none-the-wiser were it not for your explanation above. Now that makes me wonder how many other people might use it. I think it might be quite limited.

Trying to think logically, those that do know about and use it only have the one option available which is escape=“html”, so if this became the default it would have no effect other than those people don’t need to use the attribute.

For those that don’t use it, I would suspect that they don’t use those characters in their “alt” otherwise they would have the same problem that Wolfgang has and we would have other threads about it somewhere. Now I’m not saying that there aren’t any but I can’t recall seeing this problem before so maybe they are few and far between.

I’m assuming that if your “alt” is just plain text then this attribute has no effect?

I’m not a big image user so you could probably do with some comments from others, maybe people with something like a photo-blog, but I’m coming down on the side of “Change it and be damned”. :)

Last edited by thebombsite (2008-06-09 15:59:32)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#8 2008-06-09 16:39:39

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: "-Characters are missinterpreted in the alt-tags of graphics ...

The escaping only affects < > " &.

Offline

#9 2008-06-09 17:04:34

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: "-Characters are missinterpreted in the alt-tags of graphics ...

Offline

#10 2008-06-10 14:38:43

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: "-Characters are missinterpreted in the alt-tags of graphics ...

And I get the blame as well. Excellent! :)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB