Re: patch for Text/Wiki/rules/url.php

From: Date: Wed, 07 Jan 2004 02:29:27 +0000
Subject: Re: patch for Text/Wiki/rules/url.php
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-24838@lists.php.net to get a copy of this message
On Tue, Jan 06, 2004 at 07:18:26PM -0600, Paul M Jones wrote: > > On Jan 6, 2004, at 7:07 PM, Jim Winstead wrote: > > >another tiny patch. this fixes a problem with the url rule that was > >tripped up by something like: > > > ># http://www.wcsb.org/ > ># ftp://ftp.redhat.com/ > ># news://news.mozilla.org/ > > Dude, you are awesome. Will put them in 0.8 with proper attribution. > Thanks. :-) no problem. i have a more general problem with the paragraph rule, but it may be working as intended and that just differs from my intentions. ;) i would expect the output of this: <?php require 'Text/Wiki.php'; $text = "This is the first\nparagraph.\n\nThis is the second\nparagraph.\n\nThis is the third\nparagraph."; $wiki = new Text_Wiki(); echo $wiki->transform($text); to be this: <p>This is the first paragraph.</p> <p>This is the second paragraph.</p> <p>This is the third paragraph.</p> but get: This is the first<p>paragraph.</p> This is the second<p>paragraph.</p> This is the thirdparagraph. if i remove the tighten rule (or change it to turn newlines to spaces), and change the regex in the paragraph rule to '/(.*?)(\n\n|$)/s', i get the behavior i would expect (and things in general seem to be okay, although perhaps more than necessary gets wrapped in paragraphs). i'm probably just getting tripped up in understanding the wiki syntax you've implemented (since i see the example texts use \ at the end of the line for line continuation, but that seems rather ugly). what i'm working on is using Text_Wiki to parse pages from an existing PhpWiki 1.2 install. (and if you've poked around in the PhpWiki 1.3 code, you might understand why. ;) with 8 new rules (and the above tweaks), it seems to be able to handle all the pages i'm throwing at it, but i haven't really played with how those new rules may interact with the existing ones. jim

« previous php.pear.dev (#24838) next »