Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2008-09-25 02:47:56

ngeowwh
New Member
Registered: 2008-09-25
Posts: 1

Re: [textile] Textile and lists bug

Confirming this bug. Using textile v2.0 and PHP 5.2.6. Anyone got any hotfixes for this problem?

Offline

#17 2008-09-25 09:26:01

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [textile] Textile and lists bug

This bug (see opening post) was fixed in TXP 4.0.6 (which has an updated version of textile 2.0 even though the version number is the same)
If there are other problems, please open a new topic and give a detailed problem description.

Offline

#18 2009-01-30 17:19:28

greendavid
New Member
Registered: 2009-01-30
Posts: 4

Re: [textile] Textile and lists bug

Need the revised classTextile.php 2.0 with the list fix for PHP 5.2.6, separate from TXP.

Downloaded again from http://textile.thresholdstate.com/ but error persists.

Anybody know where I can get it? Thx.

Offline

#19 2009-01-30 17:22:50

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: [textile] Textile and lists bug

svn

Offline

#20 2009-01-30 17:37:20

greendavid
New Member
Registered: 2009-01-30
Posts: 4

Re: [textile] Textile and lists bug

Thanks for reference to the Google code page, but that class still gives the error.

* Item One
* Item Two
* Item Three

produces:

<ul>
    <li>Item One</li>
    <li>Item Two</li>
</ul>
<ul>
    <li>Item Three</li>
</ul>

Oh, well! All in time, I’m sure.

Offline

#21 2009-02-04 16:51:49

greendavid
New Member
Registered: 2009-01-30
Posts: 4

Re: [textile] Textile and lists bug

Bumping the patch, quoted from this post.

This works with a free-standing classTextile.php under PHP 5.2.6.

——————

You can work around the problem, by replacing these two lines (in the fList function in /textpattern/lib/classTextile.php):

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

with:

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

Last edited by greendavid (2009-02-04 16:52:10)

Offline

#22 2009-02-06 17:21:32

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [textile] Textile and lists bug

I don’t think Textile is developed separately from TXP (only as part of TXP), as far as I know, at least not by current TXP devs.

Offline

#23 2009-02-06 17:35:15

greendavid
New Member
Registered: 2009-01-30
Posts: 4

Re: [textile] Textile and lists bug

The version of classTextile.php on this page fixes two problems with a previous version:

  • Last item of UL parsed into separate list; and,
  • Class designation for links not parsed, e.g.: "(link_class)Go somewhere else":/go/somewhere/else.htm

I just copied and pasted from that page, because I don’t need all of TXP. Love it! Thanks!

Offline

#24 2009-05-05 19:22:20

ploinkr
Member
From: Montreal
Registered: 2007-12-06
Posts: 83

Re: [textile] Textile and lists bug

None of those suggestions fixed it for me, but I’m still using 4.0.5 (with PHP 5.2.6).
Anyone thinks upgrading to 4.0.8 would fix the problem?
Thanks…

Well… Just upgraded and besides having to fix a few plugin woes, the bug is still there :-P

ok!… Seems to be working now, after going back to the articles containing lists and re-saving them. Yay!

Last edited by ploinkr (2009-05-05 23:43:15)

Offline

#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