commit a48d2a9a37f31e31089df49f7ffc330300e95ae2
parent 464e38c81971b6d63bb96a55cd4f43e324e640da
Author: markseu <mark2011@mayberg.se>
Date: Mon, 16 Jun 2014 12:04:52 +0200
Better link handling
Diffstat:
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
@@ -1,4 +1,4 @@
-Yellow 0.3.2
+Yellow 0.3.3
============
Yellow is for people who make websites.
diff --git a/system/core/core-markdownextra.php b/system/core/core-markdownextra.php
@@ -5,7 +5,7 @@
// Markdown extra core plugin
class YellowMarkdownExtra
{
- const Version = "0.3.1";
+ const Version = "0.3.2";
var $yellow; //access to API
// Handle plugin initialisation
@@ -68,6 +68,8 @@ class YellowMarkdownExtraParser 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("/((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);
return $text;
}
diff --git a/system/core/core.php b/system/core/core.php
@@ -5,7 +5,7 @@
// Yellow main class
class Yellow
{
- const Version = "0.3.2";
+ const Version = "0.3.3";
var $page; //current page
var $pages; //pages from file system
var $config; //configuration
@@ -1560,7 +1560,7 @@ class YellowToolbox
// Normalise location, make absolute location
function normaliseLocation($location, $pageBase, $pageLocation)
{
- if(!preg_match("/^\w+:/", $location))
+ if(!preg_match("/^\w+:/", html_entity_decode($location, ENT_QUOTES, "UTF-8")))
{
if(preg_match("/^[^\/]+$/", $location))
{