diff options
Diffstat (limited to 'inc/parser')
-rw-r--r-- | inc/parser/handler.php | 7 | ||||
-rw-r--r-- | inc/parser/metadata.php | 1 | ||||
-rw-r--r-- | inc/parser/parser.php | 1 | ||||
-rw-r--r-- | inc/parser/xhtml.php | 26 |
4 files changed, 14 insertions, 21 deletions
diff --git a/inc/parser/handler.php b/inc/parser/handler.php index 6e6cca1a9..1de981b48 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -618,7 +618,6 @@ function Doku_Handler_Parse_Media($match) { // Split title from URL $link = explode('|',$link,2); - // Check alignment $ralign = (bool)preg_match('/^ /',$link[0]); $lalign = (bool)preg_match('/ $/',$link[0]); @@ -1341,7 +1340,6 @@ class Doku_Handler_Table { break; } - } } @@ -1368,13 +1366,13 @@ class Doku_Handler_Table { break; } - } } if (is_null($spanning_cell)) { // No spanning cell found, so convert this cell to // an empty one to avoid broken tables - $this->tableCells[$key][1][1] = ''; + $this->tableCalls[$key][0] = 'cdata'; + $this->tableCalls[$key][1][0] = ''; continue; } $this->tableCalls[$cellKey[$spanning_cell][$lastCell]][1][2]++; @@ -1403,7 +1401,6 @@ class Doku_Handler_Table { } } - // condense cdata $cnt = count($this->tableCalls); for( $key = 0; $key < $cnt; $key++){ diff --git a/inc/parser/metadata.php b/inc/parser/metadata.php index 094c3ad05..437559370 100644 --- a/inc/parser/metadata.php +++ b/inc/parser/metadata.php @@ -292,7 +292,6 @@ class Doku_Renderer_metadata extends Doku_Renderer { $id = $parts[0]; } - $default = $this->_simpleTitle($id); // first resolve and clean up the $id diff --git a/inc/parser/parser.php b/inc/parser/parser.php index 3caad834a..e39a4daf5 100644 --- a/inc/parser/parser.php +++ b/inc/parser/parser.php @@ -807,7 +807,6 @@ class Doku_Parser_Mode_quotes extends Doku_Parser_Mode { "\"",$mode,'doublequoteclosing' ); - } function getSort() { diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index e269563fe..fd02c0ce0 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -33,6 +33,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { private $lastsecid = 0; // last section edit id, used by startSectionEdit var $headers = array(); + /** @var array a list of footnotes, list starts at 1! */ var $footnotes = array(); var $lastlevel = 0; var $node = array(0,0,0,0,0); @@ -100,10 +101,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { if ( count ($this->footnotes) > 0 ) { $this->doc .= '<div class="footnotes">'.DOKU_LF; - $id = 0; - foreach ( $this->footnotes as $footnote ) { - $id++; // the number of the current footnote - + foreach ( $this->footnotes as $id => $footnote ) { // check its not a placeholder that indicates actual footnote text is elsewhere if (substr($footnote, 0, 5) != "@@FNT") { @@ -118,8 +116,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer { if (count($alt)) { foreach ($alt as $ref) { // set anchor and backlink for the other footnotes - $this->doc .= ', <sup><a href="#fnt__'.($ref+1).'" id="fn__'.($ref+1).'" class="fn_bot">'; - $this->doc .= ($ref+1).')</a></sup> '.DOKU_LF; + $this->doc .= ', <sup><a href="#fnt__'.($ref).'" id="fn__'.($ref).'" class="fn_bot">'; + $this->doc .= ($ref).')</a></sup> '.DOKU_LF; } } @@ -295,6 +293,10 @@ class Doku_Renderer_xhtml extends Doku_Renderer { * @author Andreas Gohr */ function footnote_close() { + /** @var $fnid int takes track of seen footnotes, assures they are unique even across multiple docs FS#2841 */ + static $fnid = 0; + // assign new footnote id (we start at 1) + $fnid++; // recover footnote into the stack and restore old content $footnote = $this->doc; @@ -306,17 +308,14 @@ class Doku_Renderer_xhtml extends Doku_Renderer { if ($i === false) { // its a new footnote, add it to the $footnotes array - $id = count($this->footnotes)+1; - $this->footnotes[count($this->footnotes)] = $footnote; + $this->footnotes[$fnid] = $footnote; } else { - // seen this one before, translate the index to an id and save a placeholder - $i++; - $id = count($this->footnotes)+1; - $this->footnotes[count($this->footnotes)] = "@@FNT".($i); + // seen this one before, save a placeholder + $this->footnotes[$fnid] = "@@FNT".($i); } // output the footnote reference and link - $this->doc .= '<sup><a href="#fn__'.$id.'" id="fnt__'.$id.'" class="fn_top">'.$id.')</a></sup>'; + $this->doc .= '<sup><a href="#fn__'.$fnid.'" id="fnt__'.$fnid.'" class="fn_top">'.$fnid.')</a></sup>'; } function listu_open() { @@ -737,7 +736,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $link['class'] = 'media'; } - $link['title'] = $this->_xmlEntities($url); $url = str_replace('\\','/',$url); $url = 'file:///'.$url; |