Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2004-09-12 22:32:58

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

As you will see in my test article both works perfectly here. Strange.


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

#26 2004-09-12 22:47:06

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

Re: TextilePHP -- port of Choate's "Textile 2" available

Thanx for putting that up, Obeewan

In your testpage Ø gets converted to “Ø” which the browser is happy with. At my end the same letter Ø is converted to “Ø”

As you can see here

BTW i send the charset iso-8859-1 in the header so you wont see it in the source code. Changing the charset to utf-8 has no effect on this problem.

What is up here?


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

#27 2004-09-12 22:59:55

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

Do you add them as entities to your posts? Since & infront of the Oslash is written as <code>& amp;</code> (with no space, just added cuz of Textile) in the output. Personally I just copied and pasted into my article.

And I see no <code><meta http-equiv=“content-type” content=“text/html; charset=utf-8” /></code> either.

Last edited by obeewan (2004-09-12 23:00:20)


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

#28 2004-09-13 00:29:51

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

Re: TextilePHP -- port of Choate's "Textile 2" available

Obeewan

“Do you add them as entities to your posts?”

Nope But i solved it – as you mention it was the ampersand (amp;) that was causing the prob so i forund on line 2636 in classTextile.textilephp.php:

“var $Have_Entities = 1;” which i changed to “var $Have_Entities = 0;”

And then the ampersands have gone – i am still left with the entities but they display fine :)

“And I see no < meta http-equiv=“content-type” content=“text/html; charset=utf-8” /> either.”

No i added it to the header in /publish.php around line 166 like this:

header(“Content-type: text/html; charset=iso-8859-1 Content-language: da”);

its the same result :)

So thats it – thanx for your help

/Hafnius

Last edited by hafnius (2004-09-13 00:31:48)


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

#29 2004-09-14 03:20:04

Cantide
Member
From: Wellington, New Zealand
Registered: 2004-03-03
Posts: 27
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

I’ve just installed TextilePHP and am roaring through my site with definition lists left right and centre. One thing I’ve noticed is that articles which have TXP tags as part of them, well they’re just getting ignored, and printed out as plain text. Such as

<pre><txp:section_list />
<txp:article_custom section=“company” listform=“headings” /></pre>

Is anyone else having similar troubles?

Offline

#30 2004-09-14 16:35:43

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

Re: TextilePHP -- port of Choate's "Textile 2" available

Yes Cantide…

Just found out i have to. Looking into it i found that Textilephp is makink the opening and closing brackets into html entities:

“<” becomes “&lt ;” check out the tags in the xhtml preview pane; thats why they are being ignored. Sifting through Textilephp i could not find any solution.

Any thoughts on this greatly appreciated !

/Hafnius

Last edited by hafnius (2004-09-14 20:38:26)


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

#31 2004-09-14 18:52:00

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

hafnius,

Didn’t we say you should use utf-8? (since the whole system is built with it, the data gets stored in the db in that format etc etc etc).
Thinking of this line you wrote above:
<code>header(“Content-type: text/html; charset=iso-8859-1 Content-language: da


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

#32 2004-09-14 18:54:16

obeewan
Archived Plugin Author
From: Stockholm, Sweden
Registered: 2004-08-12
Posts: 319
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

Regarding txp tags getting parsed, this problem does not pop up on my site allthough I am using TextilePHP.

Just to be sure. Are we all using the one greenrift have released or is someone using the one that that release is based on? (Allthough I do not know if they differ)


Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1

“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu

Offline

#33 2004-09-14 21:38:51

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

Re: TextilePHP -- port of Choate's "Textile 2" available

Obeewan wrote:
Didn’t we say you should use utf-8?
Are we all using the one greenrift have released?

- After extensive testing the tho only way i can have my danish characters dispayed right and stored right in the db is by using the iso-8859-1. The only problem with this as i can possibly see is that i may not be able to use all the predefined macros – but thats okey.

Yep i am using the Greenrift one – The other one cant be used since there is no function “Textilethis”.

Cantide wrote:
One thing I’ve noticed is that articles which have TXP tags as part of them, well they’re just getting ignored…

- That was my prob. I see your are using UTF-8 encoding so that cant be the reason for the difference, Since i am using iso-8859-1 and also having the prob.

I found a solution -but brace yourself its i hack ! I would love to get some feedback on this one, since i am not that ggod with either php or Textpattern yet, but here it goes:

In classtextile.php there is a function called fixEntities:

<code>
function fixEntities($text) { /* de-entify any remaining angle brackets or ampersands */ return str_replace(array(“&gt;”, “&lt;”, “&amp;”), array(“>”, “<”, “&”), $text); }
</code>

And it is referenced in the function TextileThis:

<code>
$text = $this->fixEntities($text);
</code>

This function is not in the Greenrift version so i put it there and it seems to solve the prob. now i can have txp tags in my files again.

Last edited by hafnius (2004-09-14 21:39:52)


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

#34 2004-09-14 23:04:36

Cantide
Member
From: Wellington, New Zealand
Registered: 2004-03-03
Posts: 27
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

Hey that’s not that much of a hack!:) More of a… a consolidation!

Offline

#35 2004-09-14 23:28:31

hafnius
Archived Plugin Author
From: DK
Registered: 2004-09-02
Posts: 47

Re: TextilePHP -- port of Choate's "Textile 2" available

Cantide

I would be much interested to know if this works in your context. And maybe youre right about the consolidation :)

/Hafnius


– Nobody puts Baby in the corner !
Johnny Castle, Dirty Dancing

Offline

#36 2004-09-15 01:21:00

Cantide
Member
From: Wellington, New Zealand
Registered: 2004-03-03
Posts: 27
Website

Re: TextilePHP -- port of Choate's "Textile 2" available

Yeah, it works sweet. I’m using UTF-8 if that matters at all ;)

For those who want to follow this hack, I suggest adding the fixEntities function at the end of the classTextile.textilephp.php file, just before:

<pre>} // class Textile</pre>

as it’s nice and clean that way. The other bit, function TextileThis, confused the hell out of me as I only do basic PHP. With a bit of poking around and a lot of luck, I found you can simply add:

<pre>if(!$strict) { $text = $this->fixEntities($text); }</pre>

between

<pre>$text = $this->process($text);</pre>

and

<pre>if(!empty($lite)) {</pre>

to get it to work. This I hope is exactly the same as hafnius’ hax. And that it doesn’t trigger a day-before-site-completion cascade resonance scenario, which results in total loss of data and also my computer exploding.

Last edited by Cantide (2004-09-15 01:48:06)

Offline

Board footer

Powered by FluxBB