Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
page_title escaping character entities
I entered this:
<txp:page_title separator=" &183; " />
And I get this:
My Site &#183; Section
I checked the Textbook, which includes this example:
<title><txp:page_title separator=" » " /></title>
But if I use »
I get &raquo;
.
Is there a way to use properly formatted entities as a separator, without turning the &
into &
?
Offline
Re: page_title escaping character entities
See ruud’s solution in a similar thread
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: page_title escaping character entities
Thanks. I tried that with &183;
(AKA ·
), which is Shift-Alt-9 on my Mac keyboard: ·
Textpattern didn’t escape it all— the middot appears in the source code exactly as entered in the tag.
And— it successfully validated as XHTML 1.0 Strict. I thought special characters had to be converted into &entities;
in order to validate. What’s the truth?
Offline
Re: page_title escaping character entities
johnstephens wrote:
And— it successfully validated as XHTML 1.0 Strict. I thought special characters had to be converted into
&entities;
in order to validate. What’s the truth?
Special characters should be converted into their entities but not because of validation but rather for cross-platform/browser/system uniformity.
I found that the W3 validator only throws errors with the unescaped ampersands &
but copy paste characters shuch as bull emdash etc are not recognised as being problematic.
This, in my view, is a bug with the validator.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: page_title escaping character entities
Thank you, Yiannis.
So, if I want to use this character I shouldn’t use the <txp:page_title />
tag?
Offline
Re: page_title escaping character entities
In TXP tag attribute values you should not use HTML entities. TXP tags should escape attribute values if needed automatically. In older TXP versions there were a few cases where escaping wasn’t done correctly.
Outside TXP, in the normal HTML code, when using UTF8, the only characters that need escaping are " & > <
, because those characters have special meaning in (X)HTML. Using entities for other characters (like ·) is needed only when using a character set that doesn’t support that character, so I think the W3 validator behaviour is correct.
Offline
Re: page_title escaping character entities
Thank you, Ruud, for clarifying that. Is there a good reference somewhere showing what characters are included in utf-8?
Offline
Re: page_title escaping character entities
johnstephens wrote:
Thank you, Ruud, for clarifying that. Is there a good reference somewhere showing what characters are included in utf-8?
Here it is.
Last edited by colak (2008-12-20 18:58:38)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: page_title escaping character entities
johnstephens wrote:
Thank you, Ruud, for clarifying that. Is there a good reference somewhere showing what characters are included in utf-8?
Any character in the Unicode standard. Says something? ;) That list of colaks is r-e-a-l-l-y long.
Last edited by Gocom (2008-12-20 19:10:47)
Offline
Re: page_title escaping character entities
And here’s a list apart article on the subject.
Last edited by colak (2008-12-20 19:10:51)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: page_title escaping character entities
As far as I know, all characters are included in utf8.
Offline
Re: page_title escaping character entities
Even Klingon (sort of)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Pages: 1