Revision [760]

This is an old revision of DreckFehler made by DreckFehler on 2004-07-22 14:15:39.

 

driving my own (german speaking) wakkawiki spin off called mindWiki, i have been fallen in love with the straight, compact code ;)

contact form

the following hacks and tweaks are based on WakkaWiki v. 1.2. try to figure out yourself, where to put the changes in modified code ;)


bug in rendering of lists

if a list - ordered or unordered - is put at the very begining of a page (i.e. there is no text before that list), the first item of the list will not be recognized as a list-member, because the body is trimmed before saving. the bug is located in the function $wakka->savePage().

change this code-snippet

// add new revision
$this->Query("insert into ".$this->config["table_prefix"]."pages set ".
    "tag = '".mysql_escape_string($tag)."', ".
    ($comment_on ? "comment_on = '".mysql_escape_string($comment_on)."', " : "").
    "time = now(), ".
    "owner = '".mysql_escape_string($owner)."', ".
    "user = '".mysql_escape_string($user)."', ".
    "latest = 'Y', ".
    "body = '".mysql_escape_string(trim($body))."'");


to this one

// add new revision
if (preg_match("/^([\t]+)(-|([1aiAI]\))?)/", $body, $matches)) $lead = $matches[1]; // save tab(s) of first list-definition, if any at the begining
$body = $lead.trim($body); //and write it back to the trimmed body

$this->Query("insert into ".$this->config["table_prefix"]."pages set ".
	"tag = '".mysql_escape_string($tag)."', ".
	($comment_on ? "comment_on = '".mysql_escape_string($comment_on)."', " : "").
	"time = now(), ".
	"owner = '".mysql_escape_string($owner)."', ".
	"user = '".mysql_escape_string($user)."', ".
	"latest = 'Y', ".
	"body = '".mysql_escape_string($body)."'"); // <<<<<<< trim() removed! we did it already
There is one comment on this page. [Display comment]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki