mirror of
https://github.com/danpros/htmly.git
synced 2026-04-17 19:26:08 +05:30
[TASK] update composer
This commit is contained in:
parent
ef90b19af8
commit
27c3e6253f
9 changed files with 116 additions and 159 deletions
|
|
@ -4,8 +4,8 @@
|
||||||
"optimize-autoloader": true
|
"optimize-autoloader": true
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"michelf/php-markdown": "1.4.*@dev",
|
"michelf/php-markdown": "~1.4",
|
||||||
"suin/php-rss-writer": ">=1.0",
|
"suin/php-rss-writer": "~1",
|
||||||
"kanti/hub-updater": "~0.3"
|
"kanti/hub-updater": "~0.3"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|
|
||||||
16
composer.lock
generated
16
composer.lock
generated
|
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"hash": "fd413dc0819094cfb73068fa24dc1cf0",
|
"hash": "93444ef16e9607df09bdc196135e9946",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "kanti/hub-updater",
|
"name": "kanti/hub-updater",
|
||||||
|
|
@ -46,16 +46,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "michelf/php-markdown",
|
"name": "michelf/php-markdown",
|
||||||
"version": "dev-lib",
|
"version": "1.4.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/michelf/php-markdown.git",
|
"url": "https://github.com/michelf/php-markdown.git",
|
||||||
"reference": "1b5a30e13974b490964a1610bab5958e83cd4b69"
|
"reference": "de9a19c7bf352d41cc99ed86c3c0ef17e87394b6"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/michelf/php-markdown/zipball/1b5a30e13974b490964a1610bab5958e83cd4b69",
|
"url": "https://api.github.com/repos/michelf/php-markdown/zipball/de9a19c7bf352d41cc99ed86c3c0ef17e87394b6",
|
||||||
"reference": "1b5a30e13974b490964a1610bab5958e83cd4b69",
|
"reference": "de9a19c7bf352d41cc99ed86c3c0ef17e87394b6",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|
@ -93,7 +93,7 @@
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"markdown"
|
"markdown"
|
||||||
],
|
],
|
||||||
"time": "2014-12-08 02:09:55"
|
"time": "2014-05-05 02:43:50"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "suin/php-rss-writer",
|
"name": "suin/php-rss-writer",
|
||||||
|
|
@ -144,9 +144,7 @@
|
||||||
"packages-dev": [],
|
"packages-dev": [],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"stability-flags": {
|
"stability-flags": [],
|
||||||
"michelf/php-markdown": 20
|
|
||||||
},
|
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"platform": [],
|
"platform": [],
|
||||||
"platform-dev": []
|
"platform-dev": []
|
||||||
|
|
|
||||||
|
|
@ -32,5 +32,5 @@ if (isGraterThan("2.3")) {// 2.4, 2.5, ...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
file_put_contents("index.php", file_get_contents("system/upgrade/index.php"));
|
//file_put_contents("index.php", file_get_contents("system/upgrade/index.php"));
|
||||||
rrmdir("system/upgrade/");
|
//rrmdir("system/upgrade/");
|
||||||
|
|
|
||||||
2
system/vendor/autoload.php
vendored
2
system/vendor/autoload.php
vendored
|
|
@ -4,4 +4,4 @@
|
||||||
|
|
||||||
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
||||||
|
|
||||||
return ComposerAutoloaderInita77bbbb06005e971afb84206c22613bb::getLoader();
|
return ComposerAutoloaderInit202d771b98d07410d9e52c5a90cbc9e1::getLoader();
|
||||||
|
|
|
||||||
10
system/vendor/composer/autoload_real.php
vendored
10
system/vendor/composer/autoload_real.php
vendored
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
// autoload_real.php @generated by Composer
|
// autoload_real.php @generated by Composer
|
||||||
|
|
||||||
class ComposerAutoloaderInita77bbbb06005e971afb84206c22613bb
|
class ComposerAutoloaderInit202d771b98d07410d9e52c5a90cbc9e1
|
||||||
{
|
{
|
||||||
private static $loader;
|
private static $loader;
|
||||||
|
|
||||||
|
|
@ -19,9 +19,9 @@ class ComposerAutoloaderInita77bbbb06005e971afb84206c22613bb
|
||||||
return self::$loader;
|
return self::$loader;
|
||||||
}
|
}
|
||||||
|
|
||||||
spl_autoload_register(array('ComposerAutoloaderInita77bbbb06005e971afb84206c22613bb', 'loadClassLoader'), true, true);
|
spl_autoload_register(array('ComposerAutoloaderInit202d771b98d07410d9e52c5a90cbc9e1', 'loadClassLoader'), true, true);
|
||||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||||
spl_autoload_unregister(array('ComposerAutoloaderInita77bbbb06005e971afb84206c22613bb', 'loadClassLoader'));
|
spl_autoload_unregister(array('ComposerAutoloaderInit202d771b98d07410d9e52c5a90cbc9e1', 'loadClassLoader'));
|
||||||
|
|
||||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||||
foreach ($map as $namespace => $path) {
|
foreach ($map as $namespace => $path) {
|
||||||
|
|
@ -42,14 +42,14 @@ class ComposerAutoloaderInita77bbbb06005e971afb84206c22613bb
|
||||||
|
|
||||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||||
foreach ($includeFiles as $file) {
|
foreach ($includeFiles as $file) {
|
||||||
composerRequirea77bbbb06005e971afb84206c22613bb($file);
|
composerRequire202d771b98d07410d9e52c5a90cbc9e1($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $loader;
|
return $loader;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function composerRequirea77bbbb06005e971afb84206c22613bb($file)
|
function composerRequire202d771b98d07410d9e52c5a90cbc9e1($file)
|
||||||
{
|
{
|
||||||
require $file;
|
require $file;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
106
system/vendor/composer/installed.json
vendored
106
system/vendor/composer/installed.json
vendored
|
|
@ -1,57 +1,4 @@
|
||||||
[
|
[
|
||||||
{
|
|
||||||
"name": "michelf/php-markdown",
|
|
||||||
"version": "dev-lib",
|
|
||||||
"version_normalized": "dev-lib",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/michelf/php-markdown.git",
|
|
||||||
"reference": "1b5a30e13974b490964a1610bab5958e83cd4b69"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/michelf/php-markdown/zipball/1b5a30e13974b490964a1610bab5958e83cd4b69",
|
|
||||||
"reference": "1b5a30e13974b490964a1610bab5958e83cd4b69",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.0"
|
|
||||||
},
|
|
||||||
"time": "2014-12-08 02:09:55",
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-lib": "1.4.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"installation-source": "source",
|
|
||||||
"autoload": {
|
|
||||||
"psr-0": {
|
|
||||||
"Michelf": ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"BSD-3-Clause"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Michel Fortin",
|
|
||||||
"email": "michel.fortin@michelf.ca",
|
|
||||||
"homepage": "http://michelf.ca/",
|
|
||||||
"role": "Developer"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "John Gruber",
|
|
||||||
"homepage": "http://daringfireball.net/"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "PHP Markdown",
|
|
||||||
"homepage": "http://michelf.ca/projects/php-markdown/",
|
|
||||||
"keywords": [
|
|
||||||
"markdown"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "suin/php-rss-writer",
|
"name": "suin/php-rss-writer",
|
||||||
"version": "1.3",
|
"version": "1.3",
|
||||||
|
|
@ -138,5 +85,58 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Simple Github Updater for Web Projects"
|
"description": "Simple Github Updater for Web Projects"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "michelf/php-markdown",
|
||||||
|
"version": "1.4.1",
|
||||||
|
"version_normalized": "1.4.1.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/michelf/php-markdown.git",
|
||||||
|
"reference": "de9a19c7bf352d41cc99ed86c3c0ef17e87394b6"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/michelf/php-markdown/zipball/de9a19c7bf352d41cc99ed86c3c0ef17e87394b6",
|
||||||
|
"reference": "de9a19c7bf352d41cc99ed86c3c0ef17e87394b6",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.0"
|
||||||
|
},
|
||||||
|
"time": "2014-05-05 02:43:50",
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-lib": "1.4.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"installation-source": "source",
|
||||||
|
"autoload": {
|
||||||
|
"psr-0": {
|
||||||
|
"Michelf": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-3-Clause"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Michel Fortin",
|
||||||
|
"email": "michel.fortin@michelf.ca",
|
||||||
|
"homepage": "http://michelf.ca/",
|
||||||
|
"role": "Developer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "John Gruber",
|
||||||
|
"homepage": "http://daringfireball.net/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "PHP Markdown",
|
||||||
|
"homepage": "http://michelf.ca/projects/php-markdown/",
|
||||||
|
"keywords": [
|
||||||
|
"markdown"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,6 @@ class Markdown implements MarkdownInterface {
|
||||||
public $predef_urls = array();
|
public $predef_urls = array();
|
||||||
public $predef_titles = array();
|
public $predef_titles = array();
|
||||||
|
|
||||||
# Optional filter function for URLs
|
|
||||||
public $url_filter_func = null;
|
|
||||||
|
|
||||||
|
|
||||||
### Parser Implementation ###
|
### Parser Implementation ###
|
||||||
|
|
||||||
|
|
@ -596,7 +593,7 @@ class Markdown implements MarkdownInterface {
|
||||||
|
|
||||||
if (isset($this->urls[$link_id])) {
|
if (isset($this->urls[$link_id])) {
|
||||||
$url = $this->urls[$link_id];
|
$url = $this->urls[$link_id];
|
||||||
$url = $this->encodeURLAttribute($url);
|
$url = $this->encodeAttribute($url);
|
||||||
|
|
||||||
$result = "<a href=\"$url\"";
|
$result = "<a href=\"$url\"";
|
||||||
if ( isset( $this->titles[$link_id] ) ) {
|
if ( isset( $this->titles[$link_id] ) ) {
|
||||||
|
|
@ -626,7 +623,7 @@ class Markdown implements MarkdownInterface {
|
||||||
if ($unhashed != $url)
|
if ($unhashed != $url)
|
||||||
$url = preg_replace('/^<(.*)>$/', '\1', $unhashed);
|
$url = preg_replace('/^<(.*)>$/', '\1', $unhashed);
|
||||||
|
|
||||||
$url = $this->encodeURLAttribute($url);
|
$url = $this->encodeAttribute($url);
|
||||||
|
|
||||||
$result = "<a href=\"$url\"";
|
$result = "<a href=\"$url\"";
|
||||||
if (isset($title)) {
|
if (isset($title)) {
|
||||||
|
|
@ -707,7 +704,7 @@ class Markdown implements MarkdownInterface {
|
||||||
|
|
||||||
$alt_text = $this->encodeAttribute($alt_text);
|
$alt_text = $this->encodeAttribute($alt_text);
|
||||||
if (isset($this->urls[$link_id])) {
|
if (isset($this->urls[$link_id])) {
|
||||||
$url = $this->encodeURLAttribute($this->urls[$link_id]);
|
$url = $this->encodeAttribute($this->urls[$link_id]);
|
||||||
$result = "<img src=\"$url\" alt=\"$alt_text\"";
|
$result = "<img src=\"$url\" alt=\"$alt_text\"";
|
||||||
if (isset($this->titles[$link_id])) {
|
if (isset($this->titles[$link_id])) {
|
||||||
$title = $this->titles[$link_id];
|
$title = $this->titles[$link_id];
|
||||||
|
|
@ -731,7 +728,7 @@ class Markdown implements MarkdownInterface {
|
||||||
$title =& $matches[7];
|
$title =& $matches[7];
|
||||||
|
|
||||||
$alt_text = $this->encodeAttribute($alt_text);
|
$alt_text = $this->encodeAttribute($alt_text);
|
||||||
$url = $this->encodeURLAttribute($url);
|
$url = $this->encodeAttribute($url);
|
||||||
$result = "<img src=\"$url\" alt=\"$alt_text\"";
|
$result = "<img src=\"$url\" alt=\"$alt_text\"";
|
||||||
if (isset($title)) {
|
if (isset($title)) {
|
||||||
$title = $this->encodeAttribute($title);
|
$title = $this->encodeAttribute($title);
|
||||||
|
|
@ -1263,33 +1260,6 @@ class Markdown implements MarkdownInterface {
|
||||||
$text = str_replace('"', '"', $text);
|
$text = str_replace('"', '"', $text);
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function encodeURLAttribute($url, &$text = null) {
|
|
||||||
#
|
|
||||||
# Encode text for a double-quoted HTML attribute containing a URL,
|
|
||||||
# applying the URL filter if set. Also generates the textual
|
|
||||||
# representation for the URL (removing mailto: or tel:) storing it in $text.
|
|
||||||
# This function is *not* suitable for attributes enclosed in single quotes.
|
|
||||||
#
|
|
||||||
if ($this->url_filter_func)
|
|
||||||
$url = call_user_func($this->url_filter_func, $url);
|
|
||||||
|
|
||||||
if (preg_match('{^mailto:}i', $url))
|
|
||||||
$url = $this->encodeEntityObfuscatedAttribute($url, $text, 7);
|
|
||||||
else if (preg_match('{^tel:}i', $url))
|
|
||||||
{
|
|
||||||
$url = $this->encodeAttribute($url);
|
|
||||||
$text = substr($url, 4);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$url = $this->encodeAttribute($url);
|
|
||||||
$text = $url;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $url;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected function encodeAmpsAndAngles($text) {
|
protected function encodeAmpsAndAngles($text) {
|
||||||
|
|
@ -1314,7 +1284,7 @@ class Markdown implements MarkdownInterface {
|
||||||
|
|
||||||
|
|
||||||
protected function doAutoLinks($text) {
|
protected function doAutoLinks($text) {
|
||||||
$text = preg_replace_callback('{<((https?|ftp|dict|tel):[^\'">\s]+)>}i',
|
$text = preg_replace_callback('{<((https?|ftp|dict):[^\'">\s]+)>}i',
|
||||||
array($this, '_doAutoLinks_url_callback'), $text);
|
array($this, '_doAutoLinks_url_callback'), $text);
|
||||||
|
|
||||||
# Email addresses: <address@domain.foo>
|
# Email addresses: <address@domain.foo>
|
||||||
|
|
@ -1337,46 +1307,48 @@ class Markdown implements MarkdownInterface {
|
||||||
>
|
>
|
||||||
}xi',
|
}xi',
|
||||||
array($this, '_doAutoLinks_email_callback'), $text);
|
array($this, '_doAutoLinks_email_callback'), $text);
|
||||||
|
$text = preg_replace_callback('{<(tel:([^\'">\s]+))>}i',array($this, '_doAutoLinks_tel_callback'), $text);
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
protected function _doAutoLinks_tel_callback($matches) {
|
||||||
|
$url = $this->encodeAttribute($matches[1]);
|
||||||
|
$tel = $this->encodeAttribute($matches[2]);
|
||||||
|
$link = "<a href=\"$url\">$tel</a>";
|
||||||
|
return $this->hashPart($link);
|
||||||
|
}
|
||||||
protected function _doAutoLinks_url_callback($matches) {
|
protected function _doAutoLinks_url_callback($matches) {
|
||||||
$url = $this->encodeURLAttribute($matches[1], $text);
|
$url = $this->encodeAttribute($matches[1]);
|
||||||
$link = "<a href=\"$url\">$text</a>";
|
$link = "<a href=\"$url\">$url</a>";
|
||||||
return $this->hashPart($link);
|
return $this->hashPart($link);
|
||||||
}
|
}
|
||||||
protected function _doAutoLinks_email_callback($matches) {
|
protected function _doAutoLinks_email_callback($matches) {
|
||||||
$addr = $matches[1];
|
$address = $matches[1];
|
||||||
$url = $this->encodeURLAttribute("mailto:$addr", $text);
|
$link = $this->encodeEmailAddress($address);
|
||||||
$link = "<a href=\"$url\">$text</a>";
|
|
||||||
return $this->hashPart($link);
|
return $this->hashPart($link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function encodeEntityObfuscatedAttribute($text, &$tail = null, $head_length = 0) {
|
protected function encodeEmailAddress($addr) {
|
||||||
#
|
#
|
||||||
# Input: some text to obfuscate, e.g. "mailto:foo@example.com"
|
# Input: an email address, e.g. "foo@example.com"
|
||||||
#
|
#
|
||||||
# Output: the same text but with most characters encoded as either a
|
# Output: the email address as a mailto link, with each character
|
||||||
# decimal or hex entity, in the hopes of foiling most address
|
# of the address encoded as either a decimal or hex entity, in
|
||||||
# harvesting spam bots. E.g.:
|
# the hopes of foiling most address harvesting spam bots. E.g.:
|
||||||
#
|
#
|
||||||
# mailto:foo
|
# <p><a href="mailto:foo
|
||||||
# @example.co
|
# @example.co
|
||||||
# m
|
# m">foo@exampl
|
||||||
#
|
# e.com</a></p>
|
||||||
# Note: the additional output $tail is assigned the same value as the
|
|
||||||
# ouput, minus the number of characters specified by $head_length.
|
|
||||||
#
|
#
|
||||||
# Based by a filter by Matthew Wickline, posted to BBEdit-Talk.
|
# Based by a filter by Matthew Wickline, posted to BBEdit-Talk.
|
||||||
# With some optimizations by Milian Wolff. Forced encoding of HTML
|
# With some optimizations by Milian Wolff.
|
||||||
# attribute special characters by Allan Odgaard.
|
|
||||||
#
|
#
|
||||||
if ($text == "") return $tail = "";
|
$addr = "mailto:" . $addr;
|
||||||
|
$chars = preg_split('/(?<!^)(?!$)/', $addr);
|
||||||
$chars = preg_split('/(?<!^)(?!$)/', $text);
|
$seed = (int)abs(crc32($addr) / strlen($addr)); # Deterministic seed.
|
||||||
$seed = (int)abs(crc32($text) / strlen($text)); # Deterministic seed.
|
|
||||||
|
|
||||||
foreach ($chars as $key => $char) {
|
foreach ($chars as $key => $char) {
|
||||||
$ord = ord($char);
|
$ord = ord($char);
|
||||||
# Ignore non-ascii chars.
|
# Ignore non-ascii chars.
|
||||||
|
|
@ -1384,17 +1356,18 @@ class Markdown implements MarkdownInterface {
|
||||||
$r = ($seed * (1 + $key)) % 100; # Pseudo-random function.
|
$r = ($seed * (1 + $key)) % 100; # Pseudo-random function.
|
||||||
# roughly 10% raw, 45% hex, 45% dec
|
# roughly 10% raw, 45% hex, 45% dec
|
||||||
# '@' *must* be encoded. I insist.
|
# '@' *must* be encoded. I insist.
|
||||||
# '"' and '>' have to be encoded inside the attribute
|
# '"' has to be encoded inside the attribute
|
||||||
if ($r > 90 && strpos('@"&>', $char) === false) /* do nothing */;
|
if ($r > 90 && $char != '@' && $char != '"') /* do nothing */;
|
||||||
else if ($r < 45) $chars[$key] = '&#x'.dechex($ord).';';
|
else if ($r < 45) $chars[$key] = '&#x'.dechex($ord).';';
|
||||||
else $chars[$key] = '&#'.$ord.';';
|
else $chars[$key] = '&#'.$ord.';';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$addr = implode('', $chars);
|
||||||
|
$text = implode('', array_slice($chars, 7)); # text without `mailto:`
|
||||||
|
$addr = "<a href=\"$addr\">$text</a>";
|
||||||
|
|
||||||
$text = implode('', $chars);
|
return $addr;
|
||||||
$tail = $head_length ? implode('', array_slice($chars, $head_length)) : $text;
|
|
||||||
|
|
||||||
return $text;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1678,9 +1651,9 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
||||||
### Extra Attribute Parser ###
|
### Extra Attribute Parser ###
|
||||||
|
|
||||||
# Expression to use to catch attributes (includes the braces)
|
# Expression to use to catch attributes (includes the braces)
|
||||||
protected $id_class_attr_catch_re = '\{((?:[ ]*[#.a-z][-_:a-zA-Z0-9=]+){1,})[ ]*\}';
|
protected $id_class_attr_catch_re = '\{((?:[ ]*[#.][-_:a-zA-Z0-9]+){1,})[ ]*\}';
|
||||||
# Expression to use when parsing in a context when no capture is desired
|
# Expression to use when parsing in a context when no capture is desired
|
||||||
protected $id_class_attr_nocatch_re = '\{(?:[ ]*[#.a-z][-_:a-zA-Z0-9=]+){1,}[ ]*\}';
|
protected $id_class_attr_nocatch_re = '\{(?:[ ]*[#.][-_:a-zA-Z0-9]+){1,}[ ]*\}';
|
||||||
|
|
||||||
protected function doExtraAttributes($tag_name, $attr) {
|
protected function doExtraAttributes($tag_name, $attr) {
|
||||||
#
|
#
|
||||||
|
|
@ -1692,21 +1665,17 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
||||||
if (empty($attr)) return "";
|
if (empty($attr)) return "";
|
||||||
|
|
||||||
# Split on components
|
# Split on components
|
||||||
preg_match_all('/[#.a-z][-_:a-zA-Z0-9=]+/', $attr, $matches);
|
preg_match_all('/[#.][-_:a-zA-Z0-9]+/', $attr, $matches);
|
||||||
$elements = $matches[0];
|
$elements = $matches[0];
|
||||||
|
|
||||||
# handle classes and ids (only first id taken into account)
|
# handle classes and ids (only first id taken into account)
|
||||||
$classes = array();
|
$classes = array();
|
||||||
$attributes = array();
|
|
||||||
$id = false;
|
$id = false;
|
||||||
foreach ($elements as $element) {
|
foreach ($elements as $element) {
|
||||||
if ($element{0} == '.') {
|
if ($element{0} == '.') {
|
||||||
$classes[] = substr($element, 1);
|
$classes[] = substr($element, 1);
|
||||||
} else if ($element{0} == '#') {
|
} else if ($element{0} == '#') {
|
||||||
if ($id === false) $id = substr($element, 1);
|
if ($id === false) $id = substr($element, 1);
|
||||||
} else if (strpos($element, '=') > 0) {
|
|
||||||
$parts = explode('=', $element, 2);
|
|
||||||
$attributes[] = $parts[0] . '="' . $parts[1] . '"';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1718,9 +1687,6 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
||||||
if (!empty($classes)) {
|
if (!empty($classes)) {
|
||||||
$attr_str .= ' class="'.implode(" ", $classes).'"';
|
$attr_str .= ' class="'.implode(" ", $classes).'"';
|
||||||
}
|
}
|
||||||
if (!$this->no_markup && !empty($attributes)) {
|
|
||||||
$attr_str .= ' '.implode(" ", $attributes);
|
|
||||||
}
|
|
||||||
return $attr_str;
|
return $attr_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2330,7 +2296,7 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
||||||
|
|
||||||
if (isset($this->urls[$link_id])) {
|
if (isset($this->urls[$link_id])) {
|
||||||
$url = $this->urls[$link_id];
|
$url = $this->urls[$link_id];
|
||||||
$url = $this->encodeURLAttribute($url);
|
$url = $this->encodeAttribute($url);
|
||||||
|
|
||||||
$result = "<a href=\"$url\"";
|
$result = "<a href=\"$url\"";
|
||||||
if ( isset( $this->titles[$link_id] ) ) {
|
if ( isset( $this->titles[$link_id] ) ) {
|
||||||
|
|
@ -2363,7 +2329,7 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
||||||
if ($unhashed != $url)
|
if ($unhashed != $url)
|
||||||
$url = preg_replace('/^<(.*)>$/', '\1', $unhashed);
|
$url = preg_replace('/^<(.*)>$/', '\1', $unhashed);
|
||||||
|
|
||||||
$url = $this->encodeURLAttribute($url);
|
$url = $this->encodeAttribute($url);
|
||||||
|
|
||||||
$result = "<a href=\"$url\"";
|
$result = "<a href=\"$url\"";
|
||||||
if (isset($title)) {
|
if (isset($title)) {
|
||||||
|
|
@ -2446,7 +2412,7 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
||||||
|
|
||||||
$alt_text = $this->encodeAttribute($alt_text);
|
$alt_text = $this->encodeAttribute($alt_text);
|
||||||
if (isset($this->urls[$link_id])) {
|
if (isset($this->urls[$link_id])) {
|
||||||
$url = $this->encodeURLAttribute($this->urls[$link_id]);
|
$url = $this->encodeAttribute($this->urls[$link_id]);
|
||||||
$result = "<img src=\"$url\" alt=\"$alt_text\"";
|
$result = "<img src=\"$url\" alt=\"$alt_text\"";
|
||||||
if (isset($this->titles[$link_id])) {
|
if (isset($this->titles[$link_id])) {
|
||||||
$title = $this->titles[$link_id];
|
$title = $this->titles[$link_id];
|
||||||
|
|
@ -2473,7 +2439,7 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
||||||
$attr = $this->doExtraAttributes("img", $dummy =& $matches[8]);
|
$attr = $this->doExtraAttributes("img", $dummy =& $matches[8]);
|
||||||
|
|
||||||
$alt_text = $this->encodeAttribute($alt_text);
|
$alt_text = $this->encodeAttribute($alt_text);
|
||||||
$url = $this->encodeURLAttribute($url);
|
$url = $this->encodeAttribute($url);
|
||||||
$result = "<img src=\"$url\" alt=\"$alt_text\"";
|
$result = "<img src=\"$url\" alt=\"$alt_text\"";
|
||||||
if (isset($title)) {
|
if (isset($title)) {
|
||||||
$title = $this->encodeAttribute($title);
|
$title = $this->encodeAttribute($title);
|
||||||
|
|
|
||||||
|
|
@ -32,3 +32,6 @@ interface MarkdownInterface {
|
||||||
public function transform($text);
|
public function transform($text);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
10
system/vendor/michelf/php-markdown/Readme.md
vendored
10
system/vendor/michelf/php-markdown/Readme.md
vendored
|
|
@ -174,16 +174,6 @@ PHP Markdown, please visit [michelf.ca/donate] or send Bitcoin to
|
||||||
Version History
|
Version History
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
Unreleased
|
|
||||||
|
|
||||||
* Added the ability to insert custom HTML attributes everywhere an extra
|
|
||||||
attribute block is allowed (links, images, headers). Credits to
|
|
||||||
Peter Droogmans for providing the implementation.
|
|
||||||
|
|
||||||
* Added a `url_filter_func` configuration variable which takes a function
|
|
||||||
that can rewrite any link or image URL to something different.
|
|
||||||
|
|
||||||
|
|
||||||
PHP Markdown Lib 1.4.1 (4 May 2014)
|
PHP Markdown Lib 1.4.1 (4 May 2014)
|
||||||
|
|
||||||
* The HTML block parser will now treat `<figure>` as a block-level element
|
* The HTML block parser will now treat `<figure>` as a block-level element
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue