Skip to content

Commit

Permalink
quick fix of a bug in the permalink patch
Browse files Browse the repository at this point in the history
darcs-hash:20080628192841-2b4f5-8e1226f12509bc879e3f3bdd37b8c005903165b9.gz
  • Loading branch information
foosel committed Jun 28, 2008
1 parent 58f4883 commit 4eb6b7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -432,8 +432,7 @@ function _permalinkHeader($text, $level, $pos) {
'include_header',
array(
$text,
$level,
$pos
$level
),
),
$pos
Expand Down
2 changes: 1 addition & 1 deletion syntax/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4eb6b7a

Please sign in to comment.