cvs: pear /Text_Wiki packageCreole.xml /Text_Wiki/Text/Wiki Creole.php /Text_Wiki/Text/Wiki/Parse/Creole Center.php Emphasis.php List.php
Newline.php Strong.php Table.php Underline.php Url.php /Text_Wiki/Text/Wiki/Render/Creole Center.php

From: Date: Thu, 01 Mar 2007 22:00:30 +0000
Subject: cvs: pear /Text_Wiki packageCreole.xml /Text_Wiki/Text/Wiki Creole.php /Text_Wiki/Text/Wiki/Parse/Creole Center.php Emphasis.php List.php
Newline.php Strong.php Table.php Underline.php Url.php /Text_Wiki/Text/Wiki/Render/Creole Center.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-44927@lists.php.net to get a copy of this message
mic Thu Mar 1 22:00:30 2007 UTC Modified files: /pear/Text_Wiki/Text/Wiki Creole.php /pear/Text_Wiki/Text/Wiki/Parse/Creole Center.php Emphasis.php List.php Newline.php Strong.php Table.php Underline.php Url.php /pear/Text_Wiki/Text/Wiki/Render/Creole Center.php /pear/Text_Wiki packageCreole.xml Log: email style emphasis

http://cvs.php.net/viewvc.cgi/pear/Text_Wiki/Text/Wiki/Creole.php?r1=1.7&r2=1.8&diff_format=u Index: pear/Text_Wiki/Text/Wiki/Creole.php diff -u pear/Text_Wiki/Text/Wiki/Creole.php:1.7 pear/Text_Wiki/Text/Wiki/Creole.php:1.8 --- pear/Text_Wiki/Text/Wiki/Creole.php:1.7 Fri Feb 23 14:19:18 2007 +++ pear/Text_Wiki/Text/Wiki/Creole.php Thu Mar 1 22:00:29 2007 @@ -17,7 +17,7 @@ * * @link http://pear.php.net/package/Text_Wiki * - * @version CVS: $Id: Creole.php,v 1.7 2007/02/23 14:19:18 mic Exp $ + * @version CVS: $Id: Creole.php,v 1.8 2007/03/01 22:00:29 mic Exp $ * */ @@ -94,6 +94,7 @@ $this->addPath('parse', $this->fixPath(dirname(__FILE__)).'Parse/Creole'); unset($this->renderingType); $this->setRenderConf('xhtml', 'center', 'css', 'center'); + $this->setRenderConf('xhtml', 'url', 'target', null); } function checkInnerTags(&$text) { http://cvs.php.net/viewvc.cgi/pear/Text_Wiki/Text/Wiki/Parse/Creole/Center.php?r1=1.1&r2=1.2&diff_format=u Index: pear/Text_Wiki/Text/Wiki/Parse/Creole/Center.php diff -u pear/Text_Wiki/Text/Wiki/Parse/Creole/Center.php:1.1 pear/Text_Wiki/Text/Wiki/Parse/Creole/Center.php:1.2 --- pear/Text_Wiki/Text/Wiki/Parse/Creole/Center.php:1.1 Mon Feb 19 08:56:11 2007 +++ pear/Text_Wiki/Text/Wiki/Parse/Creole/Center.php Thu Mar 1 22:00:29 2007 @@ -18,7 +18,7 @@ * * @license LGPL * - * @version $Id: Center.php,v 1.1 2007/02/19 08:56:11 mic Exp $ + * @version $Id: Center.php,v 1.2 2007/03/01 22:00:29 mic Exp $ * */ @@ -38,7 +38,7 @@ * */ - var $regex = '/^! *(.*?) *$/m'; + var $regex = '/\n\n\|(.*?)\n\n/'; /** * http://cvs.php.net/viewvc.cgi/pear/Text_Wiki/Text/Wiki/Parse/Creole/Emphasis.php?r1=1.1&r2=1.2&diff_format=u Index: pear/Text_Wiki/Text/Wiki/Parse/Creole/Emphasis.php diff -u pear/Text_Wiki/Text/Wiki/Parse/Creole/Emphasis.php:1.1 pear/Text_Wiki/Text/Wiki/Parse/Creole/Emphasis.php:1.2 --- pear/Text_Wiki/Text/Wiki/Parse/Creole/Emphasis.php:1.1 Mon Oct 23 13:11:27 2006 +++ pear/Text_Wiki/Text/Wiki/Parse/Creole/Emphasis.php Thu Mar 1 22:00:29 2007 @@ -34,7 +34,8 @@ * */ - var $regex = "/\/\/(.*?)\/\//"; + //var $regex = "/\/\/(.*?)\/\//"; + var $regex = "/(?:\/\/(.+?)\/\/|(?:(?<=[\W_\xFF])\/(?! ))(.+?)(?:(?<! )\/(?=[\W_\xFF])))/"; /** * @@ -55,7 +56,9 @@ function process(&$matches) { - if (! $this->wiki->checkInnerTags($matches[1])) { + $text = $matches[1] ? $matches[1] : $matches[2]; + + if (! $this->wiki->checkInnerTags($text)) { return $matches[0]; } @@ -69,7 +72,7 @@ array('type' => 'end') ); - return $start . $matches[1] . $end; + return $start . $text . $end; } } ?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/pear/Text_Wiki/Text/Wiki/Parse/Creole/List.php?r1=1.2&r2=1.3&diff_format=u Index: pear/Text_Wiki/Text/Wiki/Parse/Creole/List.php diff -u pear/Text_Wiki/Text/Wiki/Parse/Creole/List.php:1.2 pear/Text_Wiki/Text/Wiki/Parse/Creole/List.php:1.3 --- pear/Text_Wiki/Text/Wiki/Parse/Creole/List.php:1.2 Fri Feb 23 14:19:18 2007 +++ pear/Text_Wiki/Text/Wiki/Parse/Creole/List.php Thu Mar 1 22:00:29 2007 @@ -22,7 +22,7 @@ * * @license LGPL * - * @version $Id: List.php,v 1.2 2007/02/23 14:19:18 mic Exp $ + * @version $Id: List.php,v 1.3 2007/03/01 22:00:29 mic Exp $ * */ @@ -42,7 +42,7 @@ * */ - var $regex = '/\n([\*\-#][^\*\-#].*?)\n(?![\*\-#])/s'; + var $regex = '/\n((\*[^\*]|\-[^\-\d]|\#[^\#]).*?)\n(?![\*\-#])/s'; /** * @@ -126,27 +126,8 @@ // get the text of the list item $text = $val[3]; - // add a level to the list? - if ($level > count($stack)) { - - // the current indent level is greater than the - // number of stack elements, so we must be starting - // a new list. push the new list type onto the - // stack... - array_push($stack, $type); - - // ...and add a list-start token to the return. - $return .= $this->wiki->addToken( - $this->rule, - array( - 'type' => $type . '_list_start', - 'level' => $level - 1 - ) - ); - } - // remove a level from the list? - while (count($stack) > $level) { + while (count($stack) > $level || (count($stack) == $level && $type != $stack[$level - 1])) { // so we don't keep counting the stack, we set up a temp // var for the count. -1 becuase we're going to pop the @@ -168,12 +149,31 @@ // reset to the current (previous) list type so that // the new list item matches the proper list type. - $type = $stack[$tmp - 1]; + $oldtype = $stack[$tmp - 1]; // reset the item count for the popped indent level unset($itemcount[$tmp + 1]); } + // add a level to the list? + if ($level > count($stack)) { + + // the current indent level is greater than the + // number of stack elements, so we must be starting + // a new list. push the new list type onto the + // stack... + array_push($stack, $type); + + // ...and add a list-start token to the return. + $return .= $this->wiki->addToken( + $this->rule, + array( + 'type' => $type . '_list_start', + 'level' => $level - 1 + ) + ); + } + // add to the item count for this list (taking into account // which level we are at). if (! isset($itemcount[$level])) { @@ -215,7 +215,7 @@ // add the starting token, list-item text, and ending token // to the return. - $return .= $start . $text . $end; + $return .= "\n" . $start . $text . $end; } // the last list-item may have been indented. go through the http://cvs.php.net/viewvc.cgi/pear/Text_Wiki/Text/Wiki/Parse/Creole/Newline.php?r1=1.3&r2=1.4&diff_format=u Index: pear/Text_Wiki/Text/Wiki/Parse/Creole/Newline.php diff -u pear/Text_Wiki/Text/Wiki/Parse/Creole/Newline.php:1.3 pear/Text_Wiki/Text/Wiki/Parse/Creole/Newline.php:1.4 --- pear/Text_Wiki/Text/Wiki/Parse/Creole/Newline.php:1.3 Mon Feb 19 08:56:10 2007 +++ pear/Text_Wiki/Text/Wiki/Parse/Creole/Newline.php Thu Mar 1 22:00:29 2007 @@ -14,7 +14,7 @@ * * @license LGPL * - * @version $Id: Newline.php,v 1.3 2007/02/19 08:56:10 mic Exp $ + * @version $Id: Newline.php,v 1.4 2007/03/01 22:00:29 mic Exp $ * */ @@ -35,7 +35,7 @@ */ //var $regex = '/(?<!\n)\n(?![\n\#\=\|\-\>\:]|\*[^\*\#]|\*+ )/m'; - var $regex = '/(?<!\n)\n(?![\n\#\*\=\|\-\>\:\!])/m'; + var $regex = '/(?<!\n)\n(?!\n|\#|\*|\=|\||\>|\:|\!|\-\D)/m'; /** http://cvs.php.net/viewvc.cgi/pear/Text_Wiki/Text/Wiki/Parse/Creole/Strong.php?r1=1.1&r2=1.2&diff_format=u Index: pear/Text_Wiki/Text/Wiki/Parse/Creole/Strong.php diff -u pear/Text_Wiki/Text/Wiki/Parse/Creole/Strong.php:1.1 pear/Text_Wiki/Text/Wiki/Parse/Creole/Strong.php:1.2 --- pear/Text_Wiki/Text/Wiki/Parse/Creole/Strong.php:1.1 Mon Oct 23 13:11:27 2006 +++ pear/Text_Wiki/Text/Wiki/Parse/Creole/Strong.php Thu Mar 1 22:00:29 2007 @@ -19,7 +19,7 @@ * * @license LGPL * - * @version $Id: Strong.php,v 1.1 2006/10/23 13:11:27 mic Exp $ + * @version $Id: Strong.php,v 1.2 2007/03/01 22:00:29 mic Exp $ * */ @@ -39,7 +39,8 @@ * */ - var $regex = "/\*\*(.*?)\*\*/"; + //var $regex = "/\*\*(.*?)\*\*/"; + var $regex = "/(?:\*\*(.+?)\*\*|(?:(?<=[\W_\xFF])\*(?! ))(.+?)(?:(?<! )\*(?=[\W_\xFF])))/"; /** @@ -60,7 +61,9 @@ function process(&$matches) { - if (! $this->wiki->checkInnerTags($matches[1])) { + $text = $matches[1] ? $matches[1] : $matches[2]; + + if (! $this->wiki->checkInnerTags($text)) { return $matches[0]; } @@ -74,7 +77,7 @@ array('type' => 'end') ); - return $start . $matches[1] . $end; + return $start . $text . $end; } } ?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/pear/Text_Wiki/Text/Wiki/Parse/Creole/Table.php?r1=1.2&r2=1.3&diff_format=u Index: pear/Text_Wiki/Text/Wiki/Parse/Creole/Table.php diff -u pear/Text_Wiki/Text/Wiki/Parse/Creole/Table.php:1.2 pear/Text_Wiki/Text/Wiki/Parse/Creole/Table.php:1.3 --- pear/Text_Wiki/Text/Wiki/Parse/Creole/Table.php:1.2 Mon Feb 19 08:56:10 2007 +++ pear/Text_Wiki/Text/Wiki/Parse/Creole/Table.php Thu Mar 1 22:00:29 2007 @@ -19,7 +19,7 @@ * * @license LGPL * - * @version $Id: Table.php,v 1.2 2007/02/19 08:56:10 mic Exp $ + * @version $Id: Table.php,v 1.3 2007/03/01 22:00:29 mic Exp $ * */ @@ -103,7 +103,9 @@ // cells are separated by pipes $cells = explode("|", $row); - if (count($cells) == 1 && $cells[0][0] == '=') { + if (count($cells) == 1 && $cells[0][0] == '=' && ($num_rows == 1 || $num_rows == count($rows)) && ! $caption) { + $caption = trim(trim($cells[0], '=')); + // start the caption... $return .= $this->wiki->addToken( $this->rule, @@ -111,7 +113,7 @@ ); // ...add the content... - $return .= trim(trim($cells[0], '=')); + $return .= $caption; // ...and end the caption. $return .= $this->wiki->addToken( http://cvs.php.net/viewvc.cgi/pear/Text_Wiki/Text/Wiki/Parse/Creole/Underline.php?r1=1.1&r2=1.2&diff_format=u Index: pear/Text_Wiki/Text/Wiki/Parse/Creole/Underline.php diff -u pear/Text_Wiki/Text/Wiki/Parse/Creole/Underline.php:1.1 pear/Text_Wiki/Text/Wiki/Parse/Creole/Underline.php:1.2 --- pear/Text_Wiki/Text/Wiki/Parse/Creole/Underline.php:1.1 Fri Feb 23 14:19:18 2007 +++ pear/Text_Wiki/Text/Wiki/Parse/Creole/Underline.php Thu Mar 1 22:00:30 2007 @@ -34,7 +34,8 @@ * */ - var $regex = "/__(.*?)__/"; + //var $regex = "/__(.*?)__/"; + var $regex = "/(?:\_\_(.+?)\_\_|(?:(?<=[\W_\xFF])\_(?! ))(.+?)(?:(?<! )\_(?=[\W_\xFF])))/"; /** * @@ -55,21 +56,23 @@ function process(&$matches) { - if (! $this->wiki->checkInnerTags($matches[1])) { + $text = $matches[1] ? $matches[1] : $matches[2]; + + if (! $this->wiki->checkInnerTags($text)) { return $matches[0]; } $start = $this->wiki->addToken( - $this->rule, + 'Emphasis', // $this->rule, array('type' => 'start') ); $end = $this->wiki->addToken( - $this->rule, + 'Emphasis', // $this->rule, array('type' => 'end') ); - return $start . $matches[1] . $end; + return $start . $text . $end; } } ?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/pear/Text_Wiki/Text/Wiki/Parse/Creole/Url.php?r1=1.4&r2=1.5&diff_format=u Index: pear/Text_Wiki/Text/Wiki/Parse/Creole/Url.php diff -u pear/Text_Wiki/Text/Wiki/Parse/Creole/Url.php:1.4 pear/Text_Wiki/Text/Wiki/Parse/Creole/Url.php:1.5 --- pear/Text_Wiki/Text/Wiki/Parse/Creole/Url.php:1.4 Mon Feb 19 09:32:21 2007 +++ pear/Text_Wiki/Text/Wiki/Parse/Creole/Url.php Thu Mar 1 22:00:30 2007 @@ -20,7 +20,7 @@ * * @license LGPL * - * @version $Id: Url.php,v 1.4 2007/02/19 09:32:21 mic Exp $ + * @version $Id: Url.php,v 1.5 2007/03/01 22:00:30 mic Exp $ * */ @@ -41,7 +41,7 @@ function Text_Wiki_Parse_Url(&$obj) { parent::Text_Wiki_Parse($obj); - $this->regex = '/((?:\[\[((?:http:\/\/|https:\/\/|ftp:\/\/|gopher:\/\/|news:\/\/|mailto:|\/)[^\|\]\n ]*)(\|([^\]\n]*))?\]\])|((http:\/\/|https:\/\/|ftp:\/\/|gopher:\/\/|news:\/\/|mailto:)[^\'\"\n ' . $this->wiki->delim . ']*[A-Za-z0-9\/\?\=\&\~\_]))/'; + $this->regex = '/((?:\[\[((?:http:\/\/|https:\/\/|ftp:\/\/|mailto:|\/)[^\|\]\n ]*)(\|([^\]\n]*))?\]\])|((http:\/\/|https:\/\/|ftp:\/\/|mailto:)[^\'\"\n ' . $this->wiki->delim . ']*[A-Za-z0-9\/\?\=\&\~\_]))/'; } http://cvs.php.net/viewvc.cgi/pear/Text_Wiki/Text/Wiki/Render/Creole/Center.php?r1=1.2&r2=1.3&diff_format=u Index: pear/Text_Wiki/Text/Wiki/Render/Creole/Center.php diff -u pear/Text_Wiki/Text/Wiki/Render/Creole/Center.php:1.2 pear/Text_Wiki/Text/Wiki/Render/Creole/Center.php:1.3 --- pear/Text_Wiki/Text/Wiki/Render/Creole/Center.php:1.2 Mon Feb 19 08:54:08 2007 +++ pear/Text_Wiki/Text/Wiki/Render/Creole/Center.php Thu Mar 1 22:00:30 2007 @@ -19,7 +19,7 @@ function token($options) { if ($options['type'] == 'start') { - return "! "; + return "| "; } if ($options['type'] == 'end') { http://cvs.php.net/viewvc.cgi/pear/Text_Wiki/packageCreole.xml?r1=1.7&r2=1.8&diff_format=u Index: pear/Text_Wiki/packageCreole.xml diff -u pear/Text_Wiki/packageCreole.xml:1.7 pear/Text_Wiki/packageCreole.xml:1.8 --- pear/Text_Wiki/packageCreole.xml:1.7 Thu Feb 1 21:27:32 2007 +++ pear/Text_Wiki/packageCreole.xml Thu Mar 1 22:00:30 2007 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0"> -<!-- $Id: packageCreole.xml,v 1.7 2007/02/01 21:27:32 mic Exp $ --> +<!-- $Id: packageCreole.xml,v 1.8 2007/03/01 22:00:30 mic Exp $ --> <package version="1.0"> <name>Text_Wiki_Creole</name> <summary>Creole parser and renderer for Text_Wiki</summary> @@ -14,20 +14,22 @@ </maintainer> </maintainers> <release> - <version>0.4.2</version> - <date>2007-02-01</date> + <version>0.5.0</version> + <date>2007-03-01</date> <license>LGPL</license> <state>alpha</state> <notes> -Text_Wiki_Creole is now compliant with version 0.4 of Creole specs. See http://www.wikicreole.org/wiki/Creole0.4 +Text_Wiki_Creole is now compliant with version 0.5 of Creole specs. See http://www.wikicreole.org/wiki/Creole0.5 </notes> <filelist> <file role="php" name="Text/Wiki/Creole.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Address.php" /> - <file role="php" name="Text/Wiki/Parse/Creole/Break.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Blockquote.php" /> + <file role="php" name="Text/Wiki/Parse/Creole/Break.php" /> + <file role="php" name="Text/Wiki/Parse/Creole/Center.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Delimiter.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Emphasis.php" /> + <file role="php" name="Text/Wiki/Parse/Creole/Footnote.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Heading.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Horiz.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Image.php" /> @@ -36,12 +38,14 @@ <file role="php" name="Text/Wiki/Parse/Creole/Paragraph.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Prefilter.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Preformatted.php" /> + <file role="php" name="Text/Wiki/Parse/Creole/Raw.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Strong.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Superscript.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Table.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Tighten.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Trim.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Tt.php" /> + <file role="php" name="Text/Wiki/Parse/Creole/Underline.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Url.php" /> <file role="php" name="Text/Wiki/Parse/Creole/Wikilink.php" /> <file role="php" name="Text/Wiki/Render/Creole.php" />
« previous php.pear.cvs (#44927) next »