Skip to content
Snippets Groups Projects
Commit 506ae684 authored by andi's avatar andi
Browse files

finally valid XHTML again

darcs-hash:20050424132922-9977f-5e9acbeae431ca1c605169829e580bf094a09ef9.gz
parent c27ff579
No related branches found
No related tags found
No related merge requests found
......@@ -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
?>
......@@ -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;
}
......
......@@ -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;
}
}
......
......@@ -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'
);
......
......@@ -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).'"';
......
......@@ -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;
}
/**
......
<!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
......
<!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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment