Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2009-06-24 20:43:06

thread
New Member
Registered: 2009-06-24
Posts: 2

Re: [textile] Textile and lists bug

I’ve tried every version of classTextile.php I could find. That includes pulling a copy from Textpattern 4.0.8.

I still have the issue! I’ve tried on 2 machines and got the same results. One has PHP 5.2.8, and the other has 5.2.9-pl2-gentoo.

I’ve verified that my fList function includes the code

foreach($text as $nr => $line) {
    $nextline = isset($text[$nr+1]) ? $text[$nr+1] : false;

I’m testing this by adding the following code to the top of the textile class and running the .php file on the command line.

$g = new Textile();
echo $g->TextileThis("* test\n* test\n\n* test");

… I’d expect to see

<ul>
<li>test</li>
<li>test</li>
<li>test</li>
</ul>

but I actually get, whitespace aside,

<ul>
<li>test</li>
<li>test</li>
</ul>
<ul>
<li>test</li>
</ul>

What else is there to try!?

Thanks muchly, all.

Offline

#26 2009-06-24 21:00:41

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [textile] Textile and lists bug

Sorry, probably a superfluous question, but did you re-save your articles?

Offline

#27 2009-06-24 21:14:52

thread
New Member
Registered: 2009-06-24
Posts: 2

Re: [textile] Textile and lists bug

Doh – I had fixed it and didn’t even realize it. I got exactly what I should have given my input. :)

Sorry for the noise, all.

Offline

#28 2009-11-12 10:16:04

Aurelien @ilpleut ANTOINE
New Member
From: Belgium
Registered: 2009-11-11
Posts: 1
Website

Re: [textile] Textile and lists bug

I have the same problem with a php 5.3 (default version on mac os x snow leopard)

I tried the first bugfix,

$nextline = isset($text[$nr+1]) ? $text[$nr+1] : false;
it works for simple list, but not for list in list like this one:
  • a 1
    • b 2
    • b 3
      • c 4
    • b 5
      • c 6
        • d 7
        • d 8
  • a 9
  • a 10
    • b 11
    • b 12
  • a 13
  • a 14

there is a problem using foreach / next / updating “$line”
I replace them by a more classical structure
replace lines 466 to 471 by

function fList($m)
 {
    $text = explode("\n", $m[0]);
    $i=0;
    $nbrline=count($text);
    while($i<$nbrline) {
        $line=$text[$i];
        $i++;
        if($i==$nbrline) $nextline='';
        else $nextline=$text[$i];
        if (preg_match("/^([#*]+)($this->a$this->c) (.*)$/s", $line, $m)) {

the initial version works on textile.thresholdstate.com because it’s a 5.1.6 version
http://textile.thresholdstate.com/phpinfo.php

I think the version in textpattern has the same issue.

thanks for your work.

Last edited by Aurelien @ilpleut ANTOINE (2009-11-12 10:31:11)

Offline

#29 2010-05-28 17:51:40

mashdot
New Member
Registered: 2010-05-28
Posts: 1

Re: [textile] Textile and lists bug

I can confirm that the last post (Aurelien’s hack) works beautifully!
I use it to publish Emacs org-mode lists (headlines), simply by parsing the text file.

Many thanks!!

Offline

Board footer

Powered by FluxBB