diff --git a/inc/geshi/java.php b/inc/geshi/java.php index 045f14afd89ef7298aad42c935670c4afdf0c2f8..7a8ea2f92f32cadcf54899b5272c7d2410dc286b 100644 --- a/inc/geshi/java.php +++ b/inc/geshi/java.php @@ -1382,7 +1382,7 @@ $language_data = array ( 'URLS' => array( 1 => '', 2 => '', - 3 => 'http://www.google.com/search?q=allinurl%3A{FNAME}+java.sun.com&bntl=1', + 3 => 'http://www.google.com/search?q=allinurl%3A{FNAME}+java.sun.com&bntl=1', 4 => '' ), 'OOLANG' => true, @@ -1399,4 +1399,4 @@ $language_data = array ( ) ); -?> \ No newline at end of file +?> diff --git a/inc/html.php b/inc/html.php index 8f717f8c482784b1a9138c816cfc746c1e400c2c..efcc7e15a1fb4da2c40dadbdc0656082d0707709 100644 --- a/inc/html.php +++ b/inc/html.php @@ -125,14 +125,14 @@ function html_secedit_button($section,$p){ global $ID; global $lang; $secedit = ''; - if($p) $secedit .= "</p>\n"; +# if($p) $secedit .= "</p>\n"; $secedit .= '<div class="secedit">'; $secedit .= html_btn('secedit',$ID,'', array('do' => 'edit', 'lines' => "$section"), 'post'); $secedit .= '</div>'; - if($p) $secedit .= "\n<p>"; +# if($p) $secedit .= "\n<p>"; return $secedit; } @@ -153,7 +153,6 @@ function html_secedit($text,$show=true){ }else{ $text = preg_replace('#<!-- SECTION \[(\d*-\d*)\] -->#e','',$text); } - $text = preg_replace('@<p>\s*</p>@', '', $text); return $text; } diff --git a/inc/parser/handler.php b/inc/parser/handler.php index 23c830abf3ba4a3a0247fc9c7badce61bdeefed7..17429e69a1957dfbf45a194b291692a232861d2f 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -1185,7 +1185,29 @@ class Doku_Handler_Block { var $stackClose = array( 'footnote_close','section_close', ); - + + function closeParagraph($pos){ + // look back if there was any content - we don't want empty paragraphs + $content = ''; + for($i=count($this->calls)-1; $i>=0; $i--){ + if($this->calls[$i][0] == 'p_open'){ + break; + }elseif($this->calls[$i][0] == 'cdata'){ + $content .= $this->calls[$i][1][0]; + }else{ + $content = 'found markup'; + break; + } + } + + if(trim($content)==''){ + //remove the whole paragraph + array_splice($this->calls,$i); + }else{ + $this->calls[] = array('p_close',array(), $pos); + } + } + function process($calls) { foreach ( $calls as $key => $call ) { @@ -1212,7 +1234,8 @@ class Doku_Handler_Block { if ( in_array($call[0],$this->stackClose ) ) { if ( $this->inParagraph ) { - $this->calls[] = array('p_close',array(), $call[2]); + //$this->calls[] = array('p_close',array(), $call[2]); + $this->closeParagraph($call[2]); } $this->calls[] = $call; $this->removeFromStack(); @@ -1238,7 +1261,8 @@ class Doku_Handler_Block { if ( isset($calls[$key+1]) && $calls[$key+1][0] == 'eol' ) { if ( $this->inParagraph ) { - $this->calls[] = array('p_close',array(), $call[2]); + //$this->calls[] = array('p_close',array(), $call[2]); + $this->closeParagraph($call[2]); } $this->calls[] = array('p_open',array(), $call[2]); @@ -1260,7 +1284,8 @@ class Doku_Handler_Block { $storeCall = TRUE; if ( $this->inParagraph && in_array($call[0], $this->blockOpen) ) { - $this->calls[] = array('p_close',array(), $call[2]); + //$this->calls[] = array('p_close',array(), $call[2]); + $this->closeParagraph($call[2]); $this->inParagraph = FALSE; $this->calls[] = $call; $storeCall = FALSE; @@ -1268,7 +1293,8 @@ class Doku_Handler_Block { if ( in_array($call[0], $this->blockClose) ) { if ( $this->inParagraph ) { - $this->calls[] = array('p_close',array(), $call[2]); + //$this->calls[] = array('p_close',array(), $call[2]); + $this->closeParagraph($call[2]); $this->inParagraph = FALSE; } if ( $storeCall ) { @@ -1320,10 +1346,12 @@ class Doku_Handler_Block { // Ditch the last call array_pop($this->calls); } else if ( !in_array($call[0], $this->blockClose) ) { - $this->calls[] = array('p_close',array(), $call[2]); + //$this->calls[] = array('p_close',array(), $call[2]); + $this->closeParagraph($call[2]); } else { $last_call = array_pop($this->calls); - $this->calls[] = array('p_close',array(), $call[2]); + //$this->calls[] = array('p_close',array(), $call[2]); + $this->closeParagraph($call[2]); $this->calls[] = $last_call; } } diff --git a/inc/parser/parser.php b/inc/parser/parser.php index 23f2c13d7e8e0c38488ebcd9f692595f8350008e..d66ed5cca3f62dfadcca706b249315b4b806999e 100644 --- a/inc/parser/parser.php +++ b/inc/parser/parser.php @@ -165,10 +165,11 @@ class Doku_Parser_Mode_Footnote extends Doku_Parser_Mode { class Doku_Parser_Mode_Header extends Doku_Parser_Mode { function preConnect() { + //we're not picky about the closing ones, two are enough // Header 1 is special case - match 6 or more $this->Lexer->addSpecialPattern( - '[ \t]*={6,}[^\n]+={6,}[ \t]*\n', + '[ \t]*={6,}[^\n]+={2,}[ \t]*\n', 'base', 'header' ); @@ -176,7 +177,7 @@ class Doku_Parser_Mode_Header extends Doku_Parser_Mode { // For the rest, match exactly for ( $i = 5; $i > 1; $i--) { $this->Lexer->addSpecialPattern( - '[ \t]*={'.$i.'}[^\n]+={'.$i.'}[ \t]*\n', + '[ \t]*={'.$i.'}[^\n]+={2,}[ \t]*\n', 'base', 'header' ); diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 70a8c78304bd0b726793b02ede3ef5a6cf91c4ba..37cd36cf32cedd8399702ca2a65b3ca3cbffbb89 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -750,8 +750,12 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $ret .= ' class="media'.$align.'"'; - if (!is_null($title)) + if (!is_null($title)) { $ret .= ' title="'.$this->_xmlEntities($title).'"'; + $ret .= ' alt="'.$this->_xmlEntities($title).'"'; + }else{ + $ret .= ' alt=""'; + } if ( !is_null($width) ) $ret .= ' width="'.$this->_xmlEntities($width).'"'; diff --git a/inc/parserutils.php b/inc/parserutils.php index fd66c3f1e1b84b4288334a3281061a509c0183f8..a2d7500991fa66564f50f3e750802cba88e5ef02 100644 --- a/inc/parserutils.php +++ b/inc/parserutils.php @@ -213,7 +213,9 @@ function p_get_instructions($text){ $Parser->addMode('eol',new Doku_Parser_Mode_Eol()); // Do the parsing - return $Parser->parse($text); + $parsed = $Parser->parse($text); +# dbg($parsed); + return $parsed; } /** diff --git a/tpl/default/main.php b/tpl/default/main.php index 13274154da335b8cdc237e63c7e68b60ac170a2a..35fd977133891b16080815cfba157cc58062cd7f 100644 --- a/tpl/default/main.php +++ b/tpl/default/main.php @@ -1,5 +1,5 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" - "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <? /** * DokuWiki Default Template diff --git a/tpl/default/media.php b/tpl/default/media.php index 6509bdb5a22c6c143833045200ffc93f8769cf63..ccd140cd736f1bb2a11d5fbfa2139449b6abf6fd 100644 --- a/tpl/default/media.php +++ b/tpl/default/media.php @@ -1,4 +1,5 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <? /** * DokuWiki Default Template