Permalink
Browse files

quick fix of a bug in the permalink patch

darcs-hash:20080628192841-2b4f5-8e1226f12509bc879e3f3bdd37b8c005903165b9.gz
  • Loading branch information...
1 parent 58f4883 commit 4eb6b7ab3bcd5fc1a7e902d3cb93a3cce42f9c84 @foosel foosel committed Jun 28, 2008
Showing with 5 additions and 6 deletions.
  1. +4 −5 helper.php
  2. +1 −1 syntax/header.php
View
@@ -391,15 +391,15 @@ function _convertHeader($i) {
unset($this->ins[$i]);
return true;
} else if ($this->permalink){
- $this->ins[$i] = $this->_permalinkHeader($text, $level, $pos);
+ $this->ins[$i] = $this->_permalinkHeader($text, $level, $this->ins[$i][1][2]);
}
} else {
$level = $this->_convertSectionLevel($this->ins[$i][1][1]);
}
if ($this->mode == 'section') {
- if ($this->permalink) {
+ if (is_array($this->ins[$i][1][1])) { // permalink header
$this->ins[$i][1][1][1] = $level;
- } else {
+ } else { // normal header
$this->ins[$i][1][1] = $level;
}
}
@@ -432,8 +432,7 @@ function _permalinkHeader($text, $level, $pos) {
'include_header',
array(
$text,
- $level,
- $pos
+ $level
),
),
$pos
View
@@ -48,7 +48,7 @@ function handle($match, $state, $pos, &$handler) {
*/
function render($mode, &$renderer, $indata) {
global $ID;
- list($text, $level, $pos) = $indata;
+ list($text, $level) = $indata;
if ($mode == 'xhtml') {
$hid = $renderer->_headerToLink($text,true);

0 comments on commit 4eb6b7a

Please sign in to comment.