浏览代码

Markdown update (Wunderfeyd HTML filter)

markseu 11 年之前
父节点
当前提交
8f0089b080
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6 6
      system/core/core-markdownextra.php

+ 6 - 6
system/core/core-markdownextra.php

@@ -5,7 +5,7 @@
 // Markdown extra core plugin
 class YellowMarkdownExtra
 {
-	const Version = "0.3.9";
+	const Version = "0.3.10";
 	var $yellow;		//access to API
 	
 	// Handle plugin initialisation
@@ -18,7 +18,7 @@ class YellowMarkdownExtra
 	function onParseContentText($page, $text)
 	{
 		$markdown = new YellowMarkdownExtraParser($this->yellow, $page);
-		return $markdown->transformText($text);
+		return $markdown->transform($text);
 	}
 }
 
@@ -44,13 +44,13 @@ class YellowMarkdownExtraParser extends MarkdownExtraParser
 		parent::__construct();
 	}
 	
-	// Transform page text
-	function transformText($text)
+	// Transform text
+	function transform($text)
 	{
 		$text = preg_replace("/@pageRead/i", $this->page->get("pageRead"), $text);
 		$text = preg_replace("/@pageEdit/i", $this->page->get("pageEdit"), $text);
 		$text = preg_replace("/@pageError/i", $this->page->get("pageError"), $text);
-		return $this->transform($text);
+		return parent::transform($text);
 	}
 
 	// Return unique id attribute
@@ -83,7 +83,7 @@ class YellowMarkdownExtraParser extends MarkdownExtraParser
 	{
 		$text = preg_replace("/\s+/s", " ", $matches[2]);
 		$output = $this->page->parseType($matches[1], $text, true);
-		if(is_null($output)) $output = $matches[0];
+		if(is_null($output)) $output = htmlspecialchars($matches[0], ENT_NOQUOTES);
 		return $this->hashBlock($output);
 	}