Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
"-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 " 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
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
Re: "-Characters are missinterpreted in the alt-tags of graphics ...
I think escape=html should be the default.
Offline
Re: "-Characters are missinterpreted in the alt-tags of graphics ...
Me, too, for ages. Anyone else? Would we care about b/c?
Offline
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
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 ("
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
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
Re: "-Characters are missinterpreted in the alt-tags of graphics ...
The escaping only affects < > " &
.
Offline
Re: "-Characters are missinterpreted in the alt-tags of graphics ...
Offline
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