problem with textile and lists

Creating and modifying plugins.
Post Reply
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

problem with textile and lists

Post by stm999999999 »

hello,

I have a strange problem with textile:

something like

Code: Select all

a simple unordered list:

* test 1
* test 2
* test 3

an ordered list

# one
# two
# three

a unordered list with a ordered within

* punkt
## one
## two
* punkt
should give

Code: Select all


	<p>a simple unordered list:</p>

	<ul>
		<li>test 1</li>
		<li>test 2</li>
		<li>test 3</li>
	</ul>

	<p>an ordered list</p>

	<ol>
		<li>eins</li>
		<li>zwei</li>
		<li>drei</li>
	</ol>

	<p>a unordered list with a ordered within</p>

	<ul>
		<li>punkt
	<ol>
		<li>eins</li>
		<li>zwei</li>
	</ol></li>
		<li>punkt</li>
	</ul>


this works fine on a home installation. And it works fine on http://mein-test.supersized.org/archive ... xtile.html

but it did not work on http://test.manske-net.de/blog2/archive ... xtile.html or on another hoster http://mrm-test.sankt-joseph-siemenssta ... xtile.html

both give me every time the exact equal but wrong html-code:

Code: Select all

<p>a simple unordered list:</p>

	<ul>
	<li>test 1</li>
		<li>test 2</li>
	</ul>
	<ul>
	<li>test 3

	<p>an ordered list</p>

	<ol>
	<li>one</li>
		<li>two</li>
	</ul></li>
	</ol>
	<ol>
	<li>three

	<p>a unordered list with a ordered within</p>

	<ul>
	<li>punkt
	<ol>
	<li>one</li>
	</ol>
	</li>
	<ol>
	<li>two</li>
	</ol></li>
	</ul></li>
	</ol>
	<ul>
	<li>punkt</li>
	</ul>

main error: the third of the three first items is seperated from the lists. :-( I think all other is a subsequent error.

all installations have recent s9y-versions and the actual plugin-version.

and for comparison I have the following event-plugins on

http://test.manske-net.de/blog2/archive ... xtile.html (with errors)

Markup: Textile
version: 1.4

Spam Protector
version: 1.70

Fix common XHTML errors
version: 1.5

Spartacus
version: 2.15

Trackback-Control
version: 1.11

Static Pages
version: 3.60

and on http://mein-test.supersized.org/archive ... xtile.html (it works fine)

Textformatierung: Textile
version: 1.4

Spamschutz
version: 1.70

Übliche XHTML-Fehler beseitigen
version: 1.5

Sample!
Beinhaltet HTML-Code der im HEAD-Bereich des Blogs eingebunden werden kann, z.B. für Meta-Tags oder JavaScripts.
version: 1.3

supersized.org member plugin

Statische Seiten
version: 3.60

Bildergallerie
version: 2.42

Bildergallerie
version: 2.42

any idea!?!? :?:

(both are test-blogs, so I can give access if necessary)
Ciao, Stephan
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: problem with textile and lists

Post by garvinhicking »

Hi!

Those are the complete plugin listings? Do the textile PHP files differ?

REgards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

these are only testing blogs, so yes, this are the complete lists.

Only one change: I added Extended properties for entries to http://test.manske-net.de/blog2/archive ... xtile.html because without this, the article-cache is always on!?

if the php-text-files differ? I cannot have a look at the file on supersized, but the file on http://test.manske-net.de/blog2/ (with error) is the same as on my local installation (no error) - I just uploaded the whole plugin-folder now - no change.
Ciao, Stephan
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I can reproduce the same behaviour here on my blog: The formatting is wrong. I even tested it with Textile 2.0 (current SVN), still the same behaviour. The class is returning that code.

Sadly the textile class is too complicated for me to easily debug the behaviour. Maybe you can ask the developers of textile to see what's wrong - it's definitely a bug with their parsing class, because if I use this test.php without any s9y relevance:

Code: Select all

require_once 'classTextile.php';
$textile = new Textile();
$string = 'a simple unordered list:

* test 1
* test 2
* test 3

an ordered list

# one
# two
# three

a unordered list with a ordered within

* punkt
## one
## two
* punkt ';

echo $textile->textileThis($string);
it produceds the same error (current SVN checkout)
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

I do not believe that this is an isolated textile-problem.

I put this into the plugin-dir - on my home-installation and on http://test.manske-net.de/blog2/plugins ... extile.php

Code: Select all

<?php

require_once 'textile.php';

$string = 'a simple unordered list:

* test 1
* test 2
* test 3

an ordered list

# one
# two
# three

a unordered list with a ordered within

* punkt
## one
## two
* punkt ';

echo textile($string);

at home it gives me:

Code: Select all

<p>a simple unordered list: </p>

	<ul>
	<li>test 1 </li>
		<li>test 2 </li>
		<li>test 3 </li>
	</ul>

	<p>an ordered list </p>

	<ol>
	<li>one </li>
		<li>two </li>
		<li>three </li>
	</ol>

	<p>a unordered list with a ordered within </p>

	<ul>
	<li>punkt 
	<ol>
	<li>one </li>
		<li>two </li>
	</ol>
	</li>
		<li>punkt </li>
	</ul>

on my hosting installation:

Code: Select all

<p>a simple unordered list: </p>

	<ul>
	<li>test 1 </li>
		<li>test 2 </li>
	</ul>
	<ul>
	<li>test 3 

	<p>an ordered list </p>

	<ol>
	<li>one </li>
		<li>two </li>
	</ul></li>
	</ol>
	<ol>
	<li>three 

	<p>a unordered list with a ordered within </p>

	<ul>
	<li>punkt 
	<ol>
	<li>one </li>
	</ol>
	</li>
	<ol>
	<li>two </li>
	</ol></li>
	</ul></li>
	</ol>
	<ul>
	<li>punkt </li>
	</ul>
And, as I said, on supersized it works fine, too.
Ciao, Stephan
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I bet the textile library has a bug with certain PHP versions or PHP config settings -maybe register_globals or so? Check a phpinfo() output on the working and non-working server. One of the settings, or the PHP base version must be responsible. Which in effect is something that might be workarounded in the textile library. Maybe some usage ofo preg_match that is only supported in specific PHP versions?!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

ok, I made a list:

place
textile-error?
php-version
Zend Engine
allow_url_fopen
register_globals
register_argc_argv
zend.ze1_compatibility_mode

my local installation
no
4.3.10
v1.3.0
on
off
off
---

supersized
no
5.1.6
???

test.manske-net.de
yes
5.2.4
v2.2.0
off
off
on
on

mrm-test.sankt-joseph-siemensstadt.de
yes
5.2.4
v2.2.0
off
off
on
off

Can you give your values for your server?


I will give you a link to the original output per PM - perhaps you can see something I cannot.
Ciao, Stephan
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

I just downloaded XAMPP in the actual version.

with php 5.2.4 there is the error - with PHP Version 4.4.7 it works fine.

both uses ApacheHandler 2.0

Can you install XAMPP on your computer and try it?

http://www.apachefriends.org/de/xampp.html
Ciao, Stephan
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Post by stm999999999 »

OK, I found it:

It is a bug with textile and new php 5.2.4:

http://forum.textpattern.com/viewtopic.php?id=23997
Textile relied on non-documented behaviour when using foreach loops combined with the next function. That behaviour changed in PHP 5.2.4, so we had to patch Textile:
the patch is here: http://dev.textpattern.com/changeset/2640

We have to change in our textile.php on line 342:

old:

Code: Select all

      foreach($text as $line){
         $nextline = next($text);
new:

Code: Select all

foreach($text as $nr => $line) { 
$nextline = isset($text[$nr+1]) ? $text[$nr+1] : false;
:D
Ciao, Stephan
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Great work! :) Patched in SVN.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
kanea
Posts: 1
Joined: Thu May 19, 2011 1:13 am

Re: problem with textile and lists

Post by kanea »

It's seams, the problem is always present in the online official version.

But your solution works perfectly.

Very thanks

PS : the line has change : line 470
kehtic
Posts: 1
Joined: Wed Jun 06, 2012 12:43 pm

Re: problem with textile and lists

Post by kehtic »

kanea wrote:It's seams, the problem is always present in the online official version.

But your solution works perfectly.

Very thanks

PS : the line has change : line 470
yes it works fine for me too... done a great job...
Post Reply