Skip to content

Commit

Permalink
Fixed enumeration type [list=A] (as html type: a,A,i or I)
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.php.net/repository/pear/packages/Text_Wiki/trunk@200074 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
bertrand Gugger committed Nov 6, 2005
1 parent ead45b7 commit b01d93e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
16 changes: 11 additions & 5 deletions Text/Wiki/Parse/BBCode/List.php
Expand Up @@ -122,14 +122,14 @@ function process(&$matches)
if ($matches[1]) {
$this->_type[$this->_level] = 'number';
if (is_numeric($matches[1])) {
$param['format'] = '1';
$param['key'] = $matches[1] + 0;
$format = '1';
$key = $matches[1] + 0;
} elseif (($matches[1] == 'i') || ($matches[1] == 'I')) {
$param['format'] = $matches[1];
$format = $matches[1];
} else {
$param['format'] =
$format =
($matches[1] >= 'a') && ($matches[1] <='z') ? 'a' : 'A';
$param['key'] = $matches[1];
$key = $matches[1];
}
} else {
$this->_type[$this->_level] = 'bullet';
Expand All @@ -144,6 +144,12 @@ function process(&$matches)
'level' => $this->_level,
'count' => $this->_count[$this->_level] );
$param['type'] = $this->_type[$this->_level].'_list_start';
if (isset($format)) {
$param['format'] = $format;
}
if (isset($key)) {
$param['key'] = $key;
}
$ret = $this->wiki->addToken($this->rule, $param );
$param['type'] = $this->_type[$this->_level].'_list_end';
return $ret . $sub . $this->wiki->addToken($this->rule, $param );
Expand Down
3 changes: 2 additions & 1 deletion packageBBCode.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
<!-- $Id: packageBBCode.xml,v 1.2 2005-11-06 08:38:44 toggg Exp $ -->
<!-- $Id: packageBBCode.xml,v 1.3 2005-11-06 10:40:31 toggg Exp $ -->
<package version="1.0">
<name>Text_Wiki_BBCode</name>
<summary>BBCode parser for Text_Wiki</summary>
Expand Down Expand Up @@ -32,6 +32,7 @@
* Add superscript and subscript extension
* Option relative_enable default false for relative urls, e.g., [url=/contact.php] (Request #5767)
* Refuse ] , [ and ' in path part of the url, should be urlencoded
* Fixed enumeration type [list=A] (as html type: a,A,i or I)
</notes>
<filelist>

Expand Down

0 comments on commit b01d93e

Please sign in to comment.