From: <var...@us...> - 2009-01-21 10:32:57
|
Revision: 6425 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6425&view=rev Author: vargenau Date: 2009-01-21 10:32:50 +0000 (Wed, 21 Jan 2009) Log Message: ----------- setTightness no longer needed Modified Paths: -------------- trunk/lib/BlockParser.php trunk/lib/CachedMarkup.php trunk/lib/InlineParser.php Modified: trunk/lib/BlockParser.php =================================================================== --- trunk/lib/BlockParser.php 2009-01-21 09:35:42 UTC (rev 6424) +++ trunk/lib/BlockParser.php 2009-01-21 10:32:50 UTC (rev 6425) @@ -1,6 +1,7 @@ <?php rcs_id('$Id$'); /* Copyright (C) 2002 Geoffrey T. Dairiki <da...@da...> * Copyright (C) 2004,2005 Reini Urban + * Copyright (C) 2008 Marc-Etienne Vargenau, Alcatel-Lucent * * This file is part of PhpWiki. * @@ -22,10 +23,6 @@ require_once('lib/CachedMarkup.php'); require_once('lib/InlineParser.php'); -//////////////////////////////////////////////////////////////// -// -// - /** * Deal with paragraphs and proper, recursive block indents * for the new style markup (version 2) @@ -332,9 +329,6 @@ function Block_HtmlElement($tag /*, ... */) { $this->_init(func_get_args()); } - - function setTightness($top, $bottom) { - } } class ParsedBlock extends Block_HtmlElement { @@ -402,7 +396,6 @@ if ($line === false or $line === '') { // allow $line === '0' return false; } - $tight_top = !$this->_atSpace; $re_set = &$this->_regexpset; //FIXME: php5 fails to advance here! for ($m = $re_set->match($line); $m; $m = $re_set->nextMatch($line, $m)) { @@ -414,8 +407,6 @@ //$block->_text = $line; if (DEBUG & _DEBUG_PARSER) $input->_debug('<', get_class($block)); - $tight_bottom = ! $input->skipSpace(); - $block->_setTightness($tight_top, $tight_bottom); return $block; } if (DEBUG & _DEBUG_PARSER) @@ -476,10 +467,6 @@ trigger_error('pure virtual', E_USER_ERROR); } - function _setTightness ($top, $bot) { - $this->_element->setTightness($top, $bot); - } - function merge ($followingBlock) { return false; } @@ -546,11 +533,6 @@ return true; } - function _setTightness($top, $bot) { - $li = &$this->_content[0]; - $li->setTightness($top, $bot); - } - function merge ($nextBlock) { if (isa($nextBlock, 'Block_list') and $this->_tag == $nextBlock->_tag) { if ($nextBlock->_content === $this->_content) { @@ -588,14 +570,6 @@ return true; } - function _setTightness($top, $bot) { - $dt = &$this->_content[0]; - $dd = &$this->_content[1]; - - $dt->setTightness($top, $this->_tight_defn); - $dd->setTightness($this->_tight_defn, $bot); - } - function _do_match (&$input, $m) { $pos = $input->getPos(); @@ -648,19 +622,6 @@ $this->_setTerm($th); } - function setTightness($tight_top, $tight_bot) { - $this->_tight_top = $tight_top; - $this->_tight_bot = $tight_bot; - $first = &$this->firstTR(); - $last = &$this->lastTR(); - $first->setInClass('top', $tight_top); - if (!empty($last)) { - $last->setInClass('bottom', $tight_bot); - } else { - trigger_error(sprintf("no lastTR: %s",AsXML($this->_content[0])), E_USER_WARNING); - } - } - function _addToRow ($item) { if (empty($this->_accum)) { $this->_accum = HTML::td(); @@ -674,7 +635,6 @@ if (!empty($this->_accum)) { $row = new Block_HtmlElement('tr', false, $this->_accum); - $row->setTightness($this->_next_tight_top, $tight_bottom); $this->_next_tight_top = $tight_bottom; $this->pushContent($row); @@ -784,10 +744,6 @@ return true; } - function _setTightness($top, $bot) { - $this->_content[0]->setTightness($top, $bot); - } - function finish () { $defs = &$this->_content; @@ -849,68 +805,6 @@ $this->_content[] = new TightSubBlock($input, $indent, $m->match, $itemtag); return true; } - - function _setTightness($top, $bot) { - if (count($this->_content) == 1) { - $li = &$this->_content[0]; - $li->setTightness($top, $bot); - } - else { - // This is where php5 usually brakes. - // wrong duplicated <li> contents - if (DEBUG and DEBUG & _DEBUG_PARSER and check_php_version(5)) { - if (count($this->_content) != 2) { - echo "<pre>"; - /* - $class = new Reflection_Class('XmlElement'); - // Print out basic information - printf( - "===> The %s%s%s %s '%s' [extends %s]\n". - " declared in %s\n". - " lines %d to %d\n". - " having the modifiers %d [%s]\n", - $class->isInternal() ? 'internal' : 'user-defined', - $class->isAbstract() ? ' abstract' : '', - $class->isFinal() ? ' final' : '', - $class->isInterface() ? 'interface' : 'class', - $class->getName(), - var_export($class->getParentClass(), 1), - $class->getFileName(), - $class->getStartLine(), - $class->getEndline(), - $class->getModifiers(), - implode(' ', Reflection::getModifierNames($class->getModifiers())) - ); - // Print class properties - printf("---> Properties: %s\n", var_export($class->getProperties(), 1)); - */ - echo 'count($this->_content): ', count($this->_content),"\n"; - echo "\$this->_content[0]: "; var_dump ($this->_content[0]); - - for ($i=1; $i < min(5, count($this->_content)); $i++) { - $c =& $this->_content[$i]; - echo '$this->_content[',$i,"]: \n"; - echo "_tag: "; var_dump ($c->_tag); - echo "_content: "; var_dump ($c->_content); - echo "_properties: "; var_dump ($c->_properties); - } - debug_print_backtrace(); - if (DEBUG & _DEBUG_APD) { - if (function_exists("xdebug_get_function_stack")) { - var_dump (xdebug_get_function_stack()); - } - } - echo "</pre>"; - } - } - if (!check_php_version(5)) - assert(count($this->_content) == 2); - $dt = &$this->_content[0]; - $dd = &$this->_content[1]; - $dt->setTightness($top, false); - $dd->setTightness(false, $bot); - } - } } class Block_pre extends BlockMarkup @@ -1031,10 +925,6 @@ $this->_element = new Block_HtmlElement('hr'); return true; } - - function _setTightness($top, $bot) { - // Don't tighten <hr/>s - } } class Block_heading extends BlockMarkup @@ -1050,10 +940,6 @@ return true; } - - function _setTightness($top, $bot) { - // Don't tighten headers. - } } class Block_heading_wikicreole extends BlockMarkup @@ -1073,10 +959,6 @@ return true; } - - function _setTightness($top, $bot) { - // Don't tighten headers. - } } class Block_p extends BlockMarkup @@ -1091,11 +973,6 @@ return true; } - function _setTightness ($top, $bot) { - $this->_tight_top = $top; - $this->_tight_bot = $bot; - } - function merge ($nextBlock) { $class = get_class($nextBlock); if (strtolower($class) == 'block_p' and $this->_tight_bot) { @@ -1109,7 +986,6 @@ function finish () { $content = TransformInline(trim($this->_text)); $p = new Block_HtmlElement('p', false, $content); - $p->setTightness($this->_tight_top, $this->_tight_bot); return $p; } } @@ -1163,15 +1039,10 @@ } } $this->_element = new Block_HtmlElement($tag, $args, $content); - //$this->_element->setTightness($tag == 'span', $tag == 'span'); return true; } - function _setTightness($top, $bot) { - // Don't tighten user <div|span> - } } - //////////////////////////////////////////////////////////////// // Modified: trunk/lib/CachedMarkup.php =================================================================== --- trunk/lib/CachedMarkup.php 2009-01-21 09:35:42 UTC (rev 6424) +++ trunk/lib/CachedMarkup.php 2009-01-21 10:32:50 UTC (rev 6425) @@ -2,6 +2,7 @@ rcs_id('$Id$'); /* Copyright (C) 2002 Geoffrey T. Dairiki <da...@da...> * Copyright (C) 2004-2008 $ThePhpWikiProgrammingTeam + * Copyright (C) 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent * * This file is part of PhpWiki. * @@ -755,9 +756,6 @@ } } - function setTightness($top, $bottom) { - } - function isInlineElement() { return false; } @@ -789,69 +787,6 @@ } } -// $Log: not supported by cvs2svn $ -// Revision 1.64 2008/03/21 20:35:52 rurban -// Improve upon embedded ImgObject, such as [ *.mp3 ], objects. -// Object tags now render as label correctly and param tags are also added. -// -// Revision 1.63 2008/03/17 19:03:08 rurban -// protect $WikiTheme->VALID_LINKS -// -// Revision 1.62 2008/02/14 18:40:32 rurban -// fix DUMP_MODE with LINKS -// -// Revision 1.61 2008/01/30 19:08:59 vargenau -// Valid HTML code: we need a div, it might contain a table -// -// Revision 1.60 2007/09/15 12:28:46 rurban -// Improve multi-page format handling: abstract _DumpHtmlToDir. get rid of non-external pdf, non-global VALID_LINKS -// -// Revision 1.59 2007/09/12 19:32:29 rurban -// link only VALID_LINKS with pagelist HTML_DUMP -// -// Revision 1.58 2007/07/14 12:30:53 rurban -// include => require -// -// Revision 1.57 2007/05/28 20:13:46 rurban -// Overwrite all attributes at once at page->save to delete dangling meta -// -// Revision 1.56 2007/04/08 16:39:40 rurban -// fix when DISABLE_UNITS = true (thanks to Walter Rafelsberger) -// simplify title calculation -// -// Revision 1.55 2007/03/18 17:35:14 rurban -// Fix :DontStoreLink -// -// Revision 1.54 2007/01/25 07:41:41 rurban -// Print attribute in title. Use CSS formatting for ::= -// -// Revision 1.53 2007/01/21 23:26:52 rurban -// Translate Found by -// -// Revision 1.52 2007/01/20 15:53:51 rurban -// Rewrite of SearchHighlight: through ActionPage and InlineParser -// -// Revision 1.51 2007/01/20 11:24:53 rurban -// add SpellCheck support -// -// Revision 1.50 2007/01/07 18:41:51 rurban -// Fix fallback ZipReader syntax error. Use label=false. Add parsed plugin names to the stored tree. -// -// Revision 1.49 2007/01/04 16:40:35 rurban -// Remove units object from CachedMarkup links, Store parsed linkinfo only: basevalue, baseunit. -// -// Revision 1.48 2007/01/03 21:22:08 rurban -// Use Units for attributes. Store the unified base value as Cached_SemanticLink->_attribute_base in the wikimarkup and display it as title. -// -// Revision 1.47 2007/01/02 13:17:57 rurban -// fix semantic page links and attributes, esp. attributes. they get stored as link to empty page also. tighten semantic url expander regex, omit want_content if not necessary -// -// Revision 1.46 2006/12/22 00:11:38 rurban -// add seperate expandurl method, to simplify pagename parsing -// -// Revision 1.45 2006/10/12 06:33:50 rurban -// decide later with which class to render this link (fixes interwiki link layout) - // (c-file-style: "gnu") // Local Variables: // mode: php Modified: trunk/lib/InlineParser.php =================================================================== --- trunk/lib/InlineParser.php 2009-01-21 09:35:42 UTC (rev 6424) +++ trunk/lib/InlineParser.php 2009-01-21 10:32:50 UTC (rev 6425) @@ -27,8 +27,6 @@ * @package Markup * @author Geoffrey T. Dairiki, Reini Urban */ -/** - */ /** * This is the character used in wiki markup to escape characters with @@ -1138,7 +1136,6 @@ and isa($markup,'Markup_plugin')) { $current =& $output->_content[count($output->_content)-1]; - $current->setTightness(true,true); } $output->pushContent($match->prematch); $text = $match->postmatch; @@ -1162,11 +1159,6 @@ else $current = $markup->markup($match->match, $body); $input = $match->postmatch; - if (isset($markup) and is_object($markup) - and isa($markup,'Markup_plugin')) - { - $current->setTightness(true,true); - } $output->pushContent($match->prematch, $current); $match = $regexps->match($input); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |