Core update (Markdown without domain links)

This commit is contained in:
markseu 2015-06-10 14:53:33 +02:00
parent 5a93fd7863
commit 909ec39be8
3 changed files with 6 additions and 6 deletions

View file

@ -1,4 +1,4 @@
Yellow 0.5.21
Yellow 0.5.22
=============
[![Yellow](https://raw.githubusercontent.com/wiki/datenstrom/yellow/images/yellow.jpg)](http://datenstrom.se/yellow)

View file

@ -5,7 +5,7 @@
// Yellow main class
class Yellow
{
const Version = "0.5.21";
const Version = "0.5.22";
var $page; //current page
var $pages; //pages from file system
var $files; //files from file system

View file

@ -5,7 +5,7 @@
// Markdown plugin
class YellowMarkdown
{
const Version = "0.5.6";
const Version = "0.5.7";
var $yellow; //access to API
// Handle initialisation
@ -48,10 +48,10 @@ class YellowMarkdownParser extends MarkdownExtraParser
// Transform text
function transform($text)
{
$text = preg_replace("/@domain/i", $this->page->serverScheme."://".$this->page->serverName, $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);
$text = preg_replace("/@pageFile/i", $this->page->get("pageFile"), $text);
return parent::transform($text);
}
@ -73,7 +73,7 @@ class YellowMarkdownParser extends MarkdownExtraParser
{
$text = preg_replace_callback("/<(\w+:[^\'\">\s]+)>/", array(&$this, "_doAutoLinks_url_callback"), $text);
$text = preg_replace_callback("/<([\w\-\.]+@[\w\-\.]+)>/", array(&$this, "_doAutoLinks_email_callback"), $text);
$text = preg_replace_callback("/\[(\w+)\s+(.*?)\]/", array(&$this, "_doAutoLinks_shortcut_callback"), $text);
$text = preg_replace_callback("/\[(\w+)(.*?)\]/", array(&$this, "_doAutoLinks_shortcut_callback"), $text);
$text = preg_replace_callback("/\[\-\-(.*?)\-\-\]/", array(&$this, "_doAutoLinks_comment_callback"), $text);
$text = preg_replace_callback("/((http|https|ftp):\/\/\S+[^\'\"\,\.\;\:\s]+)/", array(&$this, "_doAutoLinks_url_callback"), $text);
$text = preg_replace_callback("/([\w\-\.]+@[\w\-\.]+\.[\w]{2,4})/", array(&$this, "_doAutoLinks_email_callback"), $text);
@ -83,7 +83,7 @@ class YellowMarkdownParser extends MarkdownExtraParser
// Handle shortcuts
function _doAutoLinks_shortcut_callback($matches)
{
$output = $this->page->parseContentBlock($matches[1], $matches[2], true);
$output = $this->page->parseContentBlock($matches[1], trim($matches[2]), true);
if(is_null($output)) $output = htmlspecialchars($matches[0], ENT_NOQUOTES);
return substr($output, 0, 4)=="<div" ? $this->hashBlock(trim($output)) : $this->hashPart(trim($output));
}