Merge pull request #686 from dawnbreak/markdown
Upgrade PHP Markdown library.
This commit is contained in:
commit
fa02f3a108
2
.gitignore
vendored
2
.gitignore
vendored
@ -63,6 +63,8 @@ nbproject/
|
||||
## composer
|
||||
# locally installed composer binary
|
||||
composer.phar
|
||||
# allow composer.lock, as it is required to have a common state
|
||||
!composer.lock
|
||||
# vendor/ is managed by composer, no need to include in our repository
|
||||
# requires new deployment and needs discussion first
|
||||
#vendor/
|
||||
|
@ -32,7 +32,7 @@ matrix:
|
||||
# - if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS hello_world_test;" -uroot; fi
|
||||
|
||||
install:
|
||||
- composer require phpunit/phpunit
|
||||
- composer install --optimize-autoloader
|
||||
|
||||
# omitting "script:" will default to phpunit
|
||||
# use the $DB env variable to determine the phpunit.xml to use
|
||||
|
@ -3,10 +3,14 @@
|
||||
namespace Zotlabs\Module\Admin;
|
||||
|
||||
use \Zotlabs\Storage\GitRepo as GitRepo;
|
||||
use \Michelf\MarkdownExtra;
|
||||
|
||||
class Plugins {
|
||||
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
function post() {
|
||||
|
||||
if(argc() > 2 && is_file("addon/" . argv(2) . "/" . argv(2) . ".php")) {
|
||||
@ -15,16 +19,15 @@ class Plugins {
|
||||
$func = argv(2) . '_plugin_admin_post';
|
||||
$func($a);
|
||||
}
|
||||
|
||||
goaway(z_root() . '/admin/plugins/' . argv(2) );
|
||||
|
||||
goaway(z_root() . '/admin/plugins/' . argv(2) );
|
||||
}
|
||||
elseif(argc() > 2) {
|
||||
switch(argv(2)) {
|
||||
case 'updaterepo':
|
||||
if (array_key_exists('repoName', $_REQUEST)) {
|
||||
$repoName = $_REQUEST['repoName'];
|
||||
}
|
||||
}
|
||||
else {
|
||||
json_return_and_die(array('message' => 'No repo name provided.', 'success' => false));
|
||||
}
|
||||
@ -101,16 +104,15 @@ class Plugins {
|
||||
logger('Repo directory not writable to web server: ' . $repoDir);
|
||||
json_return_and_die(array('message' => 'Repo directory not writable to web server.', 'success' => false));
|
||||
}
|
||||
// TODO: remove directory and unlink /addon/files
|
||||
/// @TODO remove directory and unlink /addon/files
|
||||
if (rrmdir($repoDir)) {
|
||||
json_return_and_die(array('message' => 'Repo deleted.', 'success' => true));
|
||||
} else {
|
||||
json_return_and_die(array('message' => 'Error deleting addon repo.', 'success' => false));
|
||||
}
|
||||
case 'installrepo':
|
||||
require_once('library/markdown.php');
|
||||
if (array_key_exists('repoURL', $_REQUEST)) {
|
||||
require_once('library/PHPGit.autoload.php'); // Load PHPGit dependencies
|
||||
require_once('library/PHPGit.autoload.php'); // Load PHPGit dependencies
|
||||
$repoURL = $_REQUEST['repoURL'];
|
||||
$extendDir = 'store/[data]/git/sys/extend';
|
||||
$addonDir = $extendDir . '/addon';
|
||||
@ -170,9 +172,8 @@ class Plugins {
|
||||
json_return_and_die(array('repo' => $repo, 'message' => '', 'success' => true));
|
||||
}
|
||||
case 'addrepo':
|
||||
require_once('library/markdown.php');
|
||||
if (array_key_exists('repoURL', $_REQUEST)) {
|
||||
require_once('library/PHPGit.autoload.php'); // Load PHPGit dependencies
|
||||
require_once('library/PHPGit.autoload.php'); // Load PHPGit dependencies
|
||||
$repoURL = $_REQUEST['repoURL'];
|
||||
$extendDir = 'store/[data]/git/sys/extend';
|
||||
$addonDir = $extendDir . '/addon';
|
||||
@ -225,7 +226,7 @@ class Plugins {
|
||||
$repo['readme'] = $repo['manifest'] = null;
|
||||
foreach ($git->git->tree('master') as $object) {
|
||||
if ($object['type'] == 'blob' && (strtolower($object['file']) === 'readme.md' || strtolower($object['file']) === 'readme')) {
|
||||
$repo['readme'] = Markdown($git->git->cat->blob($object['hash']));
|
||||
$repo['readme'] = MarkdownExtra::defaultTransform($git->git->cat->blob($object['hash']));
|
||||
} else if ($object['type'] == 'blob' && strtolower($object['file']) === 'manifest.json') {
|
||||
$repo['manifest'] = $git->git->cat->blob($object['hash']);
|
||||
}
|
||||
@ -241,7 +242,11 @@ class Plugins {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Plugins admin page.
|
||||
*
|
||||
* @return string with parsed HTML
|
||||
*/
|
||||
function get() {
|
||||
|
||||
/*
|
||||
@ -254,13 +259,13 @@ class Plugins {
|
||||
notice( t("Item not found.") );
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
$enabled = in_array($plugin,\App::$plugins);
|
||||
$info = get_plugin_info($plugin);
|
||||
$x = check_plugin_versions($info);
|
||||
|
||||
|
||||
// disable plugins which are installed but incompatible versions
|
||||
|
||||
|
||||
if($enabled && ! $x) {
|
||||
$enabled = false;
|
||||
$idz = array_search($plugin, \App::$plugins);
|
||||
@ -271,7 +276,7 @@ class Plugins {
|
||||
}
|
||||
}
|
||||
$info['disabled'] = 1-intval($x);
|
||||
|
||||
|
||||
if (x($_GET,"a") && $_GET['a']=="t"){
|
||||
check_form_security_token_redirectOnErr('/admin/plugins', 'admin_plugins', 't');
|
||||
$pinstalled = false;
|
||||
@ -297,9 +302,9 @@ class Plugins {
|
||||
}
|
||||
goaway(z_root() . '/admin/plugins' );
|
||||
}
|
||||
|
||||
// display plugin details
|
||||
require_once('library/markdown.php');
|
||||
|
||||
|
||||
if (in_array($plugin, \App::$plugins)){
|
||||
$status = 'on';
|
||||
$action = t('Disable');
|
||||
@ -307,21 +312,21 @@ class Plugins {
|
||||
$status = 'off';
|
||||
$action = t('Enable');
|
||||
}
|
||||
|
||||
|
||||
$readme = null;
|
||||
if (is_file("addon/$plugin/README.md")){
|
||||
$readme = file_get_contents("addon/$plugin/README.md");
|
||||
$readme = Markdown($readme);
|
||||
$readme = MarkdownExtra::defaultTransform($readme);
|
||||
} else if (is_file("addon/$plugin/README")){
|
||||
$readme = "<pre>". file_get_contents("addon/$plugin/README") ."</pre>";
|
||||
}
|
||||
|
||||
|
||||
$admin_form = '';
|
||||
|
||||
|
||||
$r = q("select * from addon where plugin_admin = 1 and aname = '%s' limit 1",
|
||||
dbesc($plugin)
|
||||
);
|
||||
|
||||
|
||||
if($r) {
|
||||
@require_once("addon/$plugin/$plugin.php");
|
||||
if(function_exists($plugin.'_plugin_admin')) {
|
||||
@ -329,8 +334,8 @@ class Plugins {
|
||||
$func($a, $admin_form);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$t = get_markup_template('admin_plugins_details.tpl');
|
||||
return replace_macros($t, array(
|
||||
'$title' => t('Administration'),
|
||||
@ -338,7 +343,7 @@ class Plugins {
|
||||
'$toggle' => t('Toggle'),
|
||||
'$settings' => t('Settings'),
|
||||
'$baseurl' => z_root(),
|
||||
|
||||
|
||||
'$plugin' => $plugin,
|
||||
'$status' => $status,
|
||||
'$action' => $action,
|
||||
@ -351,17 +356,17 @@ class Plugins {
|
||||
'$str_serverroles' => t('Compatible Server Roles: '),
|
||||
'$str_requires' => t('Requires: '),
|
||||
'$disabled' => t('Disabled - version incompatibility'),
|
||||
|
||||
|
||||
'$admin_form' => $admin_form,
|
||||
'$function' => 'plugins',
|
||||
'$screenshot' => '',
|
||||
'$readme' => $readme,
|
||||
|
||||
|
||||
'$form_security_token' => get_form_security_token('admin_plugins'),
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* List plugins
|
||||
*/
|
||||
@ -374,9 +379,9 @@ class Plugins {
|
||||
$info = get_plugin_info($id);
|
||||
$enabled = in_array($id,\App::$plugins);
|
||||
$x = check_plugin_versions($info);
|
||||
|
||||
|
||||
// disable plugins which are installed but incompatible versions
|
||||
|
||||
|
||||
if($enabled && ! $x) {
|
||||
$enabled = false;
|
||||
$idz = array_search($id, \App::$plugins);
|
||||
@ -387,19 +392,19 @@ class Plugins {
|
||||
}
|
||||
}
|
||||
$info['disabled'] = 1-intval($x);
|
||||
|
||||
|
||||
$plugins[] = array( $id, (($enabled)?"on":"off") , $info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
usort($plugins,'self::plugin_sort');
|
||||
|
||||
$allowManageRepos = false;
|
||||
if(is_writable('extend/addon') && is_writable('store/[data]')) {
|
||||
$allowManageRepos = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$admin_plugins_add_repo_form= replace_macros(
|
||||
get_markup_template('admin_plugins_addrepo.tpl'), array(
|
||||
'$post' => 'admin/plugins/addrepo',
|
||||
@ -418,14 +423,14 @@ class Plugins {
|
||||
'$cancel' => t('Cancel')
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$reponames = $this->listAddonRepos();
|
||||
$addonrepos = [];
|
||||
foreach($reponames as $repo) {
|
||||
$addonrepos[] = array('name' => $repo, 'description' => '');
|
||||
// TODO: Parse repo info to provide more information about repos
|
||||
/// @TODO Parse repo info to provide more information about repos
|
||||
}
|
||||
|
||||
|
||||
$t = get_markup_template('admin_plugins.tpl');
|
||||
return replace_macros($t, array(
|
||||
'$title' => t('Administration'),
|
||||
@ -471,5 +476,4 @@ class Plugins {
|
||||
return(strcmp(strtolower($a[2]['name']),strtolower($b[2]['name'])));
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -2,38 +2,41 @@
|
||||
|
||||
namespace Zotlabs\Module\Admin;
|
||||
|
||||
use \Michelf\MarkdownExtra;
|
||||
|
||||
/**
|
||||
* @brief Admin area theme settings.
|
||||
*/
|
||||
class Themes {
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
function post() {
|
||||
|
||||
$theme = argv(2);
|
||||
if (is_file("view/theme/$theme/php/config.php")){
|
||||
require_once("view/theme/$theme/php/config.php");
|
||||
// fixme add parent theme if derived
|
||||
if (function_exists("theme_admin_post")){
|
||||
/// @FIXME add parent theme if derived
|
||||
if (function_exists('theme_admin_post')){
|
||||
theme_admin_post($a);
|
||||
}
|
||||
}
|
||||
info(t('Theme settings updated.'));
|
||||
if(is_ajax())
|
||||
if(is_ajax())
|
||||
return;
|
||||
|
||||
|
||||
goaway(z_root() . '/admin/themes/' . $theme );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Themes admin page.
|
||||
*
|
||||
* @return string
|
||||
* @return string with parsed HTML
|
||||
*/
|
||||
|
||||
function get(){
|
||||
|
||||
$allowed_themes_str = get_config('system', 'allowed_themes');
|
||||
$allowed_themes_raw = explode(',', $allowed_themes_str);
|
||||
$allowed_themes = array();
|
||||
@ -41,7 +44,7 @@ class Themes {
|
||||
foreach($allowed_themes_raw as $x)
|
||||
if(strlen(trim($x)))
|
||||
$allowed_themes[] = trim($x);
|
||||
|
||||
|
||||
$themes = array();
|
||||
$files = glob('view/theme/*');
|
||||
if($files) {
|
||||
@ -53,56 +56,55 @@ class Themes {
|
||||
$themes[] = array('name' => $f, 'experimental' => $is_experimental, 'supported' => $is_supported, 'allowed' => $is_allowed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(! count($themes)) {
|
||||
notice( t('No themes found.'));
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Single theme
|
||||
*/
|
||||
|
||||
|
||||
if (\App::$argc == 3){
|
||||
$theme = \App::$argv[2];
|
||||
if(! is_dir("view/theme/$theme")){
|
||||
notice( t("Item not found.") );
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
if (x($_GET,"a") && $_GET['a']=="t"){
|
||||
check_form_security_token_redirectOnErr('/admin/themes', 'admin_themes', 't');
|
||||
|
||||
|
||||
// Toggle theme status
|
||||
|
||||
|
||||
$this->toggle_theme($themes, $theme, $result);
|
||||
$s = $this->rebuild_theme_table($themes);
|
||||
if($result)
|
||||
info( sprintf('Theme %s enabled.', $theme));
|
||||
else
|
||||
info( sprintf('Theme %s disabled.', $theme));
|
||||
|
||||
|
||||
set_config('system', 'allowed_themes', $s);
|
||||
goaway(z_root() . '/admin/themes' );
|
||||
}
|
||||
|
||||
|
||||
// display theme details
|
||||
require_once('library/markdown.php');
|
||||
|
||||
|
||||
if ($this->theme_status($themes,$theme)) {
|
||||
$status="on"; $action= t("Disable");
|
||||
} else {
|
||||
$status="off"; $action= t("Enable");
|
||||
}
|
||||
|
||||
|
||||
$readme=Null;
|
||||
if (is_file("view/theme/$theme/README.md")){
|
||||
$readme = file_get_contents("view/theme/$theme/README.md");
|
||||
$readme = Markdown($readme);
|
||||
$readme = MarkdownExtra::defaultTransform($readme);
|
||||
} else if (is_file("view/theme/$theme/README")){
|
||||
$readme = "<pre>". file_get_contents("view/theme/$theme/README") ."</pre>";
|
||||
$readme = '<pre>'. file_get_contents("view/theme/$theme/README") .'</pre>';
|
||||
}
|
||||
|
||||
|
||||
$admin_form = '';
|
||||
if (is_file("view/theme/$theme/php/config.php")){
|
||||
require_once("view/theme/$theme/php/config.php");
|
||||
@ -110,11 +112,11 @@ class Themes {
|
||||
$admin_form = theme_admin($a);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$screenshot = array( get_theme_screenshot($theme), t('Screenshot'));
|
||||
if(! stristr($screenshot[0],$theme))
|
||||
$screenshot = null;
|
||||
|
||||
|
||||
$t = get_markup_template('admin_plugins_details.tpl');
|
||||
return replace_macros($t, array(
|
||||
'$title' => t('Administration'),
|
||||
@ -122,7 +124,7 @@ class Themes {
|
||||
'$toggle' => t('Toggle'),
|
||||
'$settings' => t('Settings'),
|
||||
'$baseurl' => z_root(),
|
||||
|
||||
|
||||
'$plugin' => $theme,
|
||||
'$status' => $status,
|
||||
'$action' => $action,
|
||||
@ -133,22 +135,22 @@ class Themes {
|
||||
'$str_maintainer' => t('Maintainer: '),
|
||||
'$screenshot' => $screenshot,
|
||||
'$readme' => $readme,
|
||||
|
||||
|
||||
'$form_security_token' => get_form_security_token('admin_themes'),
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* List themes
|
||||
*/
|
||||
|
||||
|
||||
$xthemes = array();
|
||||
if($themes) {
|
||||
foreach($themes as $th) {
|
||||
$xthemes[] = array($th['name'],(($th['allowed']) ? "on" : "off"), get_theme_info($th['name']));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$t = get_markup_template('admin_plugins.tpl');
|
||||
return replace_macros($t, array(
|
||||
'$title' => t('Administration'),
|
||||
@ -162,13 +164,14 @@ class Themes {
|
||||
'$form_security_token' => get_form_security_token('admin_themes'),
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param array $themes
|
||||
* @param string $th
|
||||
* @param int $result
|
||||
* @brief Toggle a theme.
|
||||
*
|
||||
* @param array &$themes
|
||||
* @param[in] string $th
|
||||
* @param[out] int &$result
|
||||
*/
|
||||
function toggle_theme(&$themes, $th, &$result) {
|
||||
for($x = 0; $x < count($themes); $x ++) {
|
||||
@ -184,7 +187,7 @@ class Themes {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $themes
|
||||
* @param string $th
|
||||
@ -203,8 +206,7 @@ class Themes {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param array $themes
|
||||
* @return string
|
||||
@ -222,12 +224,5 @@ class Themes {
|
||||
}
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use \Zotlabs\Lib as Zlib;
|
||||
use \Michelf\MarkdownExtra;
|
||||
|
||||
require_once('include/acl_selectors.php');
|
||||
require_once('include/conversation.php');
|
||||
@ -242,8 +243,7 @@ class Wiki extends \Zotlabs\Web\Controller {
|
||||
$renderedContent = Zlib\NativeWikiPage::convert_links(zidify_links(smilies(bbcode($content))), argv(0) . '/' . argv(1) . '/' . $wikiUrlName);
|
||||
}
|
||||
else {
|
||||
require_once('library/markdown.php');
|
||||
$html = Zlib\NativeWikiPage::generate_toc(zidify_text(purify_html(Markdown(Zlib\NativeWikiPage::bbcode($content)))));
|
||||
$html = Zlib\NativeWikiPage::generate_toc(zidify_text(purify_html(MarkdownExtra::defaultTransform(Zlib\NativeWikiPage::bbcode($content)))));
|
||||
$renderedContent = Zlib\NativeWikiPage::convert_links($html, argv(0) . '/' . argv(1) . '/' . $wikiUrlName);
|
||||
}
|
||||
$showPageControls = $wiki_editor;
|
||||
|
@ -28,7 +28,8 @@
|
||||
"ext-mbstring" : "*",
|
||||
"ext-xml" : "*",
|
||||
"ext-openssl" : "*",
|
||||
"sabre/dav" : "~3.2"
|
||||
"sabre/dav" : "~3.2",
|
||||
"michelf/php-markdown" : "^1.7"
|
||||
},
|
||||
"require-dev" : {
|
||||
"php" : ">=5.6",
|
||||
@ -52,4 +53,4 @@
|
||||
"config" : {
|
||||
"notify-on-install" : false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
3303
composer.lock
generated
Normal file
3303
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use \Michelf\MarkdownExtra;
|
||||
|
||||
/**
|
||||
* @brief
|
||||
*
|
||||
@ -15,7 +17,7 @@ function get_help_content($tocpath = false) {
|
||||
$text = '';
|
||||
|
||||
$path = (($tocpath !== false) ? $tocpath : '');
|
||||
|
||||
|
||||
if($tocpath === false && argc() > 1) {
|
||||
$path = '';
|
||||
for($x = 1; $x < argc(); $x ++) {
|
||||
@ -55,7 +57,7 @@ function get_help_content($tocpath = false) {
|
||||
if(! $text) {
|
||||
$doctype = 'bbcode';
|
||||
$text = load_doc_file('doc/main.bb');
|
||||
goaway('/help/about/about_hubzilla');
|
||||
goaway('/help/about/about_hubzilla');
|
||||
\App::$page['title'] = t('Help');
|
||||
}
|
||||
|
||||
@ -69,12 +71,11 @@ function get_help_content($tocpath = false) {
|
||||
}
|
||||
|
||||
if($doctype === 'html')
|
||||
$content = parseIdentityAwareHTML($text);
|
||||
if($doctype === 'markdown') {
|
||||
require_once('library/markdown.php');
|
||||
$content = parseIdentityAwareHTML($text);
|
||||
if($doctype === 'markdown') {
|
||||
# escape #include tags
|
||||
$text = preg_replace('/#include/ism', '%%include', $text);
|
||||
$content = Markdown($text);
|
||||
$content = MarkdownExtra::defaultTransform($text);
|
||||
$content = preg_replace('/%%include/ism', '#include', $content);
|
||||
}
|
||||
if($doctype === 'bbcode') {
|
||||
@ -99,8 +100,7 @@ function preg_callback_help_include($matches) {
|
||||
$include = str_replace(' target="_blank"','',$include);
|
||||
}
|
||||
elseif(preg_match('/\.md$/', $matches[1])) {
|
||||
require_once('library/markdown.php');
|
||||
$include = Markdown($include);
|
||||
$include = MarkdownExtra::defaultTransform($include);
|
||||
}
|
||||
return $include;
|
||||
}
|
||||
|
@ -4,9 +4,10 @@
|
||||
* @brief Some functions for BB conversions for Diaspora protocol.
|
||||
*/
|
||||
|
||||
use Michelf\MarkdownExtra;
|
||||
|
||||
require_once("include/oembed.php");
|
||||
require_once("include/event.php");
|
||||
require_once("library/markdown.php");
|
||||
require_once("include/html2bbcode.php");
|
||||
require_once("include/bbcode.php");
|
||||
require_once("library/markdownify/markdownify.php");
|
||||
@ -73,7 +74,7 @@ function bb_tag_preg_replace($pattern, $replace, $name, $s) {
|
||||
|
||||
function share_shield($m) {
|
||||
return str_replace($m[1],'!=+=+=!' . base64url_encode($m[1]) . '=+!=+!=',$m[0]);
|
||||
}
|
||||
}
|
||||
|
||||
function share_unshield($m) {
|
||||
$x = str_replace(array('!=+=+=!','=+!=+!='),array('',''),$m[1]);
|
||||
@ -184,7 +185,7 @@ function markdown_to_bb($s, $use_zrl = false) {
|
||||
// This seems to work
|
||||
$s = preg_replace('/\#([^\s\#])/','#$1',$s);
|
||||
|
||||
$s = Markdown($s);
|
||||
$s = MarkdownExtra::defaultTransform($s);
|
||||
|
||||
$s = str_replace("\r","",$s);
|
||||
|
||||
@ -299,7 +300,7 @@ function bb2dmention_callback($match) {
|
||||
|
||||
$r = q("select xchan_addr from xchan where xchan_url = '%s'",
|
||||
dbesc($match[2])
|
||||
);
|
||||
);
|
||||
|
||||
if($r)
|
||||
return '@{' . $match[3] . ' ; ' . $r[0]['xchan_addr'] . '}';
|
||||
@ -333,7 +334,7 @@ function bb2diaspora_itemwallwall(&$item,$uplink = false) {
|
||||
$has_meta = true;
|
||||
|
||||
if($item['author_xchan'] != $item['owner_xchan']) {
|
||||
if($item['mid'] == $item['parent_mid'])
|
||||
if($item['mid'] == $item['parent_mid'])
|
||||
$wallwall = true;
|
||||
else {
|
||||
if(! $has_meta) {
|
||||
@ -348,12 +349,12 @@ function bb2diaspora_itemwallwall(&$item,$uplink = false) {
|
||||
if(($wallwall) && (is_array($item['author'])) && $item['author']['xchan_url'] && $item['author']['xchan_name'] && $item['author']['xchan_photo_s']) {
|
||||
logger('bb2diaspora_itemwallwall: wall to wall post',LOGGER_DEBUG);
|
||||
// post will come across with the owner's identity. Throw a preamble onto the post to indicate the true author.
|
||||
$item['body'] = "\n\n"
|
||||
. '[quote]'
|
||||
. '[img]' . $item['author']['xchan_photo_s'] . '[/img]'
|
||||
. ' '
|
||||
. '[url=' . $item['author']['xchan_url'] . '][b]' . $item['author']['xchan_name'] . '[/b][/url]' . "\n\n"
|
||||
. $item['body']
|
||||
$item['body'] = "\n\n"
|
||||
. '[quote]'
|
||||
. '[img]' . $item['author']['xchan_photo_s'] . '[/img]'
|
||||
. ' '
|
||||
. '[url=' . $item['author']['xchan_url'] . '][b]' . $item['author']['xchan_name'] . '[/b][/url]' . "\n\n"
|
||||
. $item['body']
|
||||
. '[/quote]';
|
||||
}
|
||||
|
||||
@ -490,7 +491,7 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) {
|
||||
// Convert it to HTML - don't try oembed
|
||||
$Text = bbcode($Text, $preserve_nl, false);
|
||||
|
||||
// Markdownify does not preserve previously escaped html entities such as <> and &.
|
||||
// Markdownify does not preserve previously escaped html entities such as <> and &.
|
||||
|
||||
$Text = str_replace(array('<','>','&'),array('&_lt_;','&_gt_;','&_amp_;'),$Text);
|
||||
|
||||
@ -500,7 +501,7 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) {
|
||||
|
||||
|
||||
|
||||
// It also adds backslashes to our attempt at getting around the html entity preservation for some weird reason.
|
||||
// It also adds backslashes to our attempt at getting around the html entity preservation for some weird reason.
|
||||
|
||||
$Text = str_replace(array('&\\_lt\\_;','&\\_gt\\_;','&\\_amp\\_;'),array('<','>','&'),$Text);
|
||||
|
||||
@ -510,7 +511,7 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) {
|
||||
// So take off the angle brackets of any such URL
|
||||
$Text = preg_replace("/<http(.*?)>/is", "http$1", $Text);
|
||||
|
||||
// Remove empty zrl links
|
||||
// Remove empty zrl links
|
||||
$Text = preg_replace("/\[zrl\=\].*?\[\/zrl\]/is", "", $Text);
|
||||
|
||||
// Remove all unconverted tags
|
||||
@ -543,22 +544,22 @@ function format_event_diaspora($ev) {
|
||||
$o .= '**' . (($ev['summary']) ? bb2diaspora($ev['summary']) : bb2diaspora($ev['desc'])) . '**' . "\n";
|
||||
|
||||
$o .= t('Starts:') . ' ' . '['
|
||||
. (($ev['adjust']) ? day_translate(datetime_convert('UTC', 'UTC',
|
||||
. (($ev['adjust']) ? day_translate(datetime_convert('UTC', 'UTC',
|
||||
$ev['start'] , $bd_format ))
|
||||
: day_translate(datetime_convert('UTC', 'UTC',
|
||||
: day_translate(datetime_convert('UTC', 'UTC',
|
||||
$ev['start'] , $bd_format)))
|
||||
. '](' . z_root() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['start'])) . ")\n";
|
||||
|
||||
if(! $ev['nofinish'])
|
||||
$o .= t('Finishes:') . ' ' . '['
|
||||
. (($ev['adjust']) ? day_translate(datetime_convert('UTC', 'UTC',
|
||||
$o .= t('Finishes:') . ' ' . '['
|
||||
. (($ev['adjust']) ? day_translate(datetime_convert('UTC', 'UTC',
|
||||
$ev['finish'] , $bd_format ))
|
||||
: day_translate(datetime_convert('UTC', 'UTC',
|
||||
: day_translate(datetime_convert('UTC', 'UTC',
|
||||
$ev['finish'] , $bd_format )))
|
||||
. '](' . z_root() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['finish'])) . ")\n";
|
||||
|
||||
if(strlen($ev['location']))
|
||||
$o .= t('Location:') . bb2diaspora($ev['location'])
|
||||
$o .= t('Location:') . bb2diaspora($ev['location'])
|
||||
. "\n";
|
||||
|
||||
$o .= "\n";
|
||||
|
@ -3,8 +3,9 @@
|
||||
* @file include/text.php
|
||||
*/
|
||||
|
||||
require_once("include/bbcode.php");
|
||||
use \Michelf\MarkdownExtra;
|
||||
|
||||
require_once("include/bbcode.php");
|
||||
|
||||
// random string, there are 86 characters max in text mode, 128 for hex
|
||||
// output is urlsafe
|
||||
@ -1650,8 +1651,7 @@ function prepare_text($text, $content_type = 'text/bbcode', $cache = false) {
|
||||
break;
|
||||
|
||||
case 'text/markdown':
|
||||
require_once('library/markdown.php');
|
||||
$s = Markdown($text);
|
||||
$s = MarkdownExtra::defaultTransform($text);
|
||||
break;
|
||||
|
||||
case 'application/x-pdl';
|
||||
@ -2062,7 +2062,7 @@ function ids_to_array($arr,$idx = 'id') {
|
||||
$t = array();
|
||||
if($arr) {
|
||||
foreach($arr as $x) {
|
||||
if(array_key_exists($idx,$x) && strlen($x[$idx]) && (! in_array($x[$idx],$t))) {
|
||||
if(array_key_exists($idx,$x) && strlen($x[$idx]) && (! in_array($x[$idx],$t))) {
|
||||
$t[] = $x[$idx];
|
||||
}
|
||||
}
|
||||
@ -2078,7 +2078,7 @@ function ids_to_querystr($arr,$idx = 'id',$quote = false) {
|
||||
if($arr) {
|
||||
foreach($arr as $x) {
|
||||
if(! in_array($x[$idx],$t)) {
|
||||
if($quote)
|
||||
if($quote)
|
||||
$t[] = "'" . dbesc($x[$idx]) . "'";
|
||||
else
|
||||
$t[] = $x[$idx];
|
||||
|
2932
library/markdown.php
2932
library/markdown.php
File diff suppressed because it is too large
Load Diff
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -2,6 +2,6 @@
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit7b34d7e50a62201ec5d5e526a5b8b35d::getLoader();
|
||||
|
36
vendor/composer/ClassLoader.php
vendored
36
vendor/composer/ClassLoader.php
vendored
@ -55,6 +55,7 @@ class ClassLoader
|
||||
private $classMap = array();
|
||||
private $classMapAuthoritative = false;
|
||||
private $missingClasses = array();
|
||||
private $apcuPrefix;
|
||||
|
||||
public function getPrefixes()
|
||||
{
|
||||
@ -271,6 +272,26 @@ class ClassLoader
|
||||
return $this->classMapAuthoritative;
|
||||
}
|
||||
|
||||
/**
|
||||
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
||||
*
|
||||
* @param string|null $apcuPrefix
|
||||
*/
|
||||
public function setApcuPrefix($apcuPrefix)
|
||||
{
|
||||
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The APCu prefix in use, or null if APCu caching is not enabled.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getApcuPrefix()
|
||||
{
|
||||
return $this->apcuPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers this instance as an autoloader.
|
||||
*
|
||||
@ -313,11 +334,6 @@ class ClassLoader
|
||||
*/
|
||||
public function findFile($class)
|
||||
{
|
||||
// work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
|
||||
if ('\\' == $class[0]) {
|
||||
$class = substr($class, 1);
|
||||
}
|
||||
|
||||
// class map lookup
|
||||
if (isset($this->classMap[$class])) {
|
||||
return $this->classMap[$class];
|
||||
@ -325,6 +341,12 @@ class ClassLoader
|
||||
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
||||
return false;
|
||||
}
|
||||
if (null !== $this->apcuPrefix) {
|
||||
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
||||
if ($hit) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
$file = $this->findFileWithExtension($class, '.php');
|
||||
|
||||
@ -333,6 +355,10 @@ class ClassLoader
|
||||
$file = $this->findFileWithExtension($class, '.hh');
|
||||
}
|
||||
|
||||
if (null !== $this->apcuPrefix) {
|
||||
apcu_add($this->apcuPrefix.$class, $file);
|
||||
}
|
||||
|
||||
if (false === $file) {
|
||||
// Remember that this class does not exist.
|
||||
$this->missingClasses[$class] = true;
|
||||
|
13
vendor/composer/autoload_classmap.php
vendored
13
vendor/composer/autoload_classmap.php
vendored
@ -7,6 +7,9 @@ $baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Hubzilla\\Import\\Import' => $baseDir . '/include/Import/Importer.php',
|
||||
'Michelf\\Markdown' => $vendorDir . '/michelf/php-markdown/Michelf/Markdown.php',
|
||||
'Michelf\\MarkdownExtra' => $vendorDir . '/michelf/php-markdown/Michelf/MarkdownExtra.php',
|
||||
'Michelf\\MarkdownInterface' => $vendorDir . '/michelf/php-markdown/Michelf/MarkdownInterface.php',
|
||||
'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php',
|
||||
'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php',
|
||||
'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php',
|
||||
@ -265,6 +268,7 @@ return array(
|
||||
'Sabre\\HTTP\\URLUtil' => $vendorDir . '/sabre/http/lib/URLUtil.php',
|
||||
'Sabre\\HTTP\\Util' => $vendorDir . '/sabre/http/lib/Util.php',
|
||||
'Sabre\\HTTP\\Version' => $vendorDir . '/sabre/http/lib/Version.php',
|
||||
'Sabre\\Uri\\InvalidUriException' => $vendorDir . '/sabre/uri/lib/InvalidUriException.php',
|
||||
'Sabre\\Uri\\Version' => $vendorDir . '/sabre/uri/lib/Version.php',
|
||||
'Sabre\\VObject\\BirthdayCalendarGenerator' => $vendorDir . '/sabre/vobject/lib/BirthdayCalendarGenerator.php',
|
||||
'Sabre\\VObject\\Cli' => $vendorDir . '/sabre/vobject/lib/Cli.php',
|
||||
@ -357,6 +361,7 @@ return array(
|
||||
'Zotlabs\\Access\\PermissionLimits' => $baseDir . '/Zotlabs/Access/PermissionLimits.php',
|
||||
'Zotlabs\\Access\\PermissionRoles' => $baseDir . '/Zotlabs/Access/PermissionRoles.php',
|
||||
'Zotlabs\\Access\\Permissions' => $baseDir . '/Zotlabs/Access/Permissions.php',
|
||||
'Zotlabs\\Daemon\\Addon' => $baseDir . '/Zotlabs/Daemon/Addon.php',
|
||||
'Zotlabs\\Daemon\\Checksites' => $baseDir . '/Zotlabs/Daemon/Checksites.php',
|
||||
'Zotlabs\\Daemon\\Cli_suggest' => $baseDir . '/Zotlabs/Daemon/Cli_suggest.php',
|
||||
'Zotlabs\\Daemon\\Cron' => $baseDir . '/Zotlabs/Daemon/Cron.php',
|
||||
@ -391,7 +396,10 @@ return array(
|
||||
'Zotlabs\\Lib\\Enotify' => $baseDir . '/Zotlabs/Lib/Enotify.php',
|
||||
'Zotlabs\\Lib\\ExtendedZip' => $baseDir . '/Zotlabs/Lib/ExtendedZip.php',
|
||||
'Zotlabs\\Lib\\IConfig' => $baseDir . '/Zotlabs/Lib/IConfig.php',
|
||||
'Zotlabs\\Lib\\NativeWiki' => $baseDir . '/Zotlabs/Lib/NativeWiki.php',
|
||||
'Zotlabs\\Lib\\NativeWikiPage' => $baseDir . '/Zotlabs/Lib/NativeWikiPage.php',
|
||||
'Zotlabs\\Lib\\PConfig' => $baseDir . '/Zotlabs/Lib/PConfig.php',
|
||||
'Zotlabs\\Lib\\Permcat' => $baseDir . '/Zotlabs/Lib/Permcat.php',
|
||||
'Zotlabs\\Lib\\PermissionDescription' => $baseDir . '/Zotlabs/Lib/PermissionDescription.php',
|
||||
'Zotlabs\\Lib\\ProtoDriver' => $baseDir . '/Zotlabs/Lib/ProtoDriver.php',
|
||||
'Zotlabs\\Lib\\SuperCurl' => $baseDir . '/Zotlabs/Lib/SuperCurl.php',
|
||||
@ -478,7 +486,6 @@ return array(
|
||||
'Zotlabs\\Module\\Magic' => $baseDir . '/Zotlabs/Module/Magic.php',
|
||||
'Zotlabs\\Module\\Mail' => $baseDir . '/Zotlabs/Module/Mail.php',
|
||||
'Zotlabs\\Module\\Manage' => $baseDir . '/Zotlabs/Module/Manage.php',
|
||||
'Zotlabs\\Module\\Match' => $baseDir . '/Zotlabs/Module/Match.php',
|
||||
'Zotlabs\\Module\\Menu' => $baseDir . '/Zotlabs/Module/Menu.php',
|
||||
'Zotlabs\\Module\\Message' => $baseDir . '/Zotlabs/Module/Message.php',
|
||||
'Zotlabs\\Module\\Mitem' => $baseDir . '/Zotlabs/Module/Mitem.php',
|
||||
@ -496,6 +503,7 @@ return array(
|
||||
'Zotlabs\\Module\\Page' => $baseDir . '/Zotlabs/Module/Page.php',
|
||||
'Zotlabs\\Module\\Pconfig' => $baseDir . '/Zotlabs/Module/Pconfig.php',
|
||||
'Zotlabs\\Module\\Pdledit' => $baseDir . '/Zotlabs/Module/Pdledit.php',
|
||||
'Zotlabs\\Module\\Permcat' => $baseDir . '/Zotlabs/Module/Permcat.php',
|
||||
'Zotlabs\\Module\\Photo' => $baseDir . '/Zotlabs/Module/Photo.php',
|
||||
'Zotlabs\\Module\\Photos' => $baseDir . '/Zotlabs/Module/Photos.php',
|
||||
'Zotlabs\\Module\\Ping' => $baseDir . '/Zotlabs/Module/Ping.php',
|
||||
@ -525,7 +533,6 @@ return array(
|
||||
'Zotlabs\\Module\\Removeme' => $baseDir . '/Zotlabs/Module/Removeme.php',
|
||||
'Zotlabs\\Module\\Rmagic' => $baseDir . '/Zotlabs/Module/Rmagic.php',
|
||||
'Zotlabs\\Module\\Rpost' => $baseDir . '/Zotlabs/Module/Rpost.php',
|
||||
'Zotlabs\\Module\\Rsd_xml' => $baseDir . '/Zotlabs/Module/Rsd_xml.php',
|
||||
'Zotlabs\\Module\\Search' => $baseDir . '/Zotlabs/Module/Search.php',
|
||||
'Zotlabs\\Module\\Search_ac' => $baseDir . '/Zotlabs/Module/Search_ac.php',
|
||||
'Zotlabs\\Module\\Service_limits' => $baseDir . '/Zotlabs/Module/Service_limits.php',
|
||||
@ -536,6 +543,7 @@ return array(
|
||||
'Zotlabs\\Module\\Settings\\Featured' => $baseDir . '/Zotlabs/Module/Settings/Featured.php',
|
||||
'Zotlabs\\Module\\Settings\\Features' => $baseDir . '/Zotlabs/Module/Settings/Features.php',
|
||||
'Zotlabs\\Module\\Settings\\Oauth' => $baseDir . '/Zotlabs/Module/Settings/Oauth.php',
|
||||
'Zotlabs\\Module\\Settings\\Permcats' => $baseDir . '/Zotlabs/Module/Settings/Permcats.php',
|
||||
'Zotlabs\\Module\\Settings\\Tokens' => $baseDir . '/Zotlabs/Module/Settings/Tokens.php',
|
||||
'Zotlabs\\Module\\Setup' => $baseDir . '/Zotlabs/Module/Setup.php',
|
||||
'Zotlabs\\Module\\Share' => $baseDir . '/Zotlabs/Module/Share.php',
|
||||
@ -596,6 +604,7 @@ return array(
|
||||
'Zotlabs\\Text\\Tagadelic' => $baseDir . '/Zotlabs/Text/Tagadelic.php',
|
||||
'Zotlabs\\Web\\CheckJS' => $baseDir . '/Zotlabs/Web/CheckJS.php',
|
||||
'Zotlabs\\Web\\Controller' => $baseDir . '/Zotlabs/Web/Controller.php',
|
||||
'Zotlabs\\Web\\HTTPHeaders' => $baseDir . '/Zotlabs/Web/HTTPHeaders.php',
|
||||
'Zotlabs\\Web\\HttpMeta' => $baseDir . '/Zotlabs/Web/HttpMeta.php',
|
||||
'Zotlabs\\Web\\Router' => $baseDir . '/Zotlabs/Web/Router.php',
|
||||
'Zotlabs\\Web\\Session' => $baseDir . '/Zotlabs/Web/Session.php',
|
||||
|
1
vendor/composer/autoload_namespaces.php
vendored
1
vendor/composer/autoload_namespaces.php
vendored
@ -6,4 +6,5 @@ $vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Michelf' => array($vendorDir . '/michelf/php-markdown'),
|
||||
);
|
||||
|
2
vendor/composer/autoload_real.php
vendored
2
vendor/composer/autoload_real.php
vendored
@ -23,7 +23,7 @@ class ComposerAutoloaderInit7b34d7e50a62201ec5d5e526a5b8b35d
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit7b34d7e50a62201ec5d5e526a5b8b35d', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
||||
if ($useStaticLoader) {
|
||||
require_once __DIR__ . '/autoload_static.php';
|
||||
|
||||
|
26
vendor/composer/autoload_static.php
vendored
26
vendor/composer/autoload_static.php
vendored
@ -94,8 +94,21 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixesPsr0 = array (
|
||||
'M' =>
|
||||
array (
|
||||
'Michelf' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/michelf/php-markdown',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'Hubzilla\\Import\\Import' => __DIR__ . '/../..' . '/include/Import/Importer.php',
|
||||
'Michelf\\Markdown' => __DIR__ . '/..' . '/michelf/php-markdown/Michelf/Markdown.php',
|
||||
'Michelf\\MarkdownExtra' => __DIR__ . '/..' . '/michelf/php-markdown/Michelf/MarkdownExtra.php',
|
||||
'Michelf\\MarkdownInterface' => __DIR__ . '/..' . '/michelf/php-markdown/Michelf/MarkdownInterface.php',
|
||||
'Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/AbstractLogger.php',
|
||||
'Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/Psr/Log/InvalidArgumentException.php',
|
||||
'Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/Psr/Log/LogLevel.php',
|
||||
@ -354,6 +367,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
|
||||
'Sabre\\HTTP\\URLUtil' => __DIR__ . '/..' . '/sabre/http/lib/URLUtil.php',
|
||||
'Sabre\\HTTP\\Util' => __DIR__ . '/..' . '/sabre/http/lib/Util.php',
|
||||
'Sabre\\HTTP\\Version' => __DIR__ . '/..' . '/sabre/http/lib/Version.php',
|
||||
'Sabre\\Uri\\InvalidUriException' => __DIR__ . '/..' . '/sabre/uri/lib/InvalidUriException.php',
|
||||
'Sabre\\Uri\\Version' => __DIR__ . '/..' . '/sabre/uri/lib/Version.php',
|
||||
'Sabre\\VObject\\BirthdayCalendarGenerator' => __DIR__ . '/..' . '/sabre/vobject/lib/BirthdayCalendarGenerator.php',
|
||||
'Sabre\\VObject\\Cli' => __DIR__ . '/..' . '/sabre/vobject/lib/Cli.php',
|
||||
@ -446,6 +460,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
|
||||
'Zotlabs\\Access\\PermissionLimits' => __DIR__ . '/../..' . '/Zotlabs/Access/PermissionLimits.php',
|
||||
'Zotlabs\\Access\\PermissionRoles' => __DIR__ . '/../..' . '/Zotlabs/Access/PermissionRoles.php',
|
||||
'Zotlabs\\Access\\Permissions' => __DIR__ . '/../..' . '/Zotlabs/Access/Permissions.php',
|
||||
'Zotlabs\\Daemon\\Addon' => __DIR__ . '/../..' . '/Zotlabs/Daemon/Addon.php',
|
||||
'Zotlabs\\Daemon\\Checksites' => __DIR__ . '/../..' . '/Zotlabs/Daemon/Checksites.php',
|
||||
'Zotlabs\\Daemon\\Cli_suggest' => __DIR__ . '/../..' . '/Zotlabs/Daemon/Cli_suggest.php',
|
||||
'Zotlabs\\Daemon\\Cron' => __DIR__ . '/../..' . '/Zotlabs/Daemon/Cron.php',
|
||||
@ -480,7 +495,10 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
|
||||
'Zotlabs\\Lib\\Enotify' => __DIR__ . '/../..' . '/Zotlabs/Lib/Enotify.php',
|
||||
'Zotlabs\\Lib\\ExtendedZip' => __DIR__ . '/../..' . '/Zotlabs/Lib/ExtendedZip.php',
|
||||
'Zotlabs\\Lib\\IConfig' => __DIR__ . '/../..' . '/Zotlabs/Lib/IConfig.php',
|
||||
'Zotlabs\\Lib\\NativeWiki' => __DIR__ . '/../..' . '/Zotlabs/Lib/NativeWiki.php',
|
||||
'Zotlabs\\Lib\\NativeWikiPage' => __DIR__ . '/../..' . '/Zotlabs/Lib/NativeWikiPage.php',
|
||||
'Zotlabs\\Lib\\PConfig' => __DIR__ . '/../..' . '/Zotlabs/Lib/PConfig.php',
|
||||
'Zotlabs\\Lib\\Permcat' => __DIR__ . '/../..' . '/Zotlabs/Lib/Permcat.php',
|
||||
'Zotlabs\\Lib\\PermissionDescription' => __DIR__ . '/../..' . '/Zotlabs/Lib/PermissionDescription.php',
|
||||
'Zotlabs\\Lib\\ProtoDriver' => __DIR__ . '/../..' . '/Zotlabs/Lib/ProtoDriver.php',
|
||||
'Zotlabs\\Lib\\SuperCurl' => __DIR__ . '/../..' . '/Zotlabs/Lib/SuperCurl.php',
|
||||
@ -539,7 +557,6 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
|
||||
'Zotlabs\\Module\\Events' => __DIR__ . '/../..' . '/Zotlabs/Module/Events.php',
|
||||
'Zotlabs\\Module\\Fbrowser' => __DIR__ . '/../..' . '/Zotlabs/Module/Fbrowser.php',
|
||||
'Zotlabs\\Module\\Feed' => __DIR__ . '/../..' . '/Zotlabs/Module/Feed.php',
|
||||
'Zotlabs\\Module\\Ffsapi' => __DIR__ . '/../..' . '/Zotlabs/Module/Ffsapi.php',
|
||||
'Zotlabs\\Module\\Fhublocs' => __DIR__ . '/../..' . '/Zotlabs/Module/Fhublocs.php',
|
||||
'Zotlabs\\Module\\File_upload' => __DIR__ . '/../..' . '/Zotlabs/Module/File_upload.php',
|
||||
'Zotlabs\\Module\\Filer' => __DIR__ . '/../..' . '/Zotlabs/Module/Filer.php',
|
||||
@ -568,7 +585,6 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
|
||||
'Zotlabs\\Module\\Magic' => __DIR__ . '/../..' . '/Zotlabs/Module/Magic.php',
|
||||
'Zotlabs\\Module\\Mail' => __DIR__ . '/../..' . '/Zotlabs/Module/Mail.php',
|
||||
'Zotlabs\\Module\\Manage' => __DIR__ . '/../..' . '/Zotlabs/Module/Manage.php',
|
||||
'Zotlabs\\Module\\Match' => __DIR__ . '/../..' . '/Zotlabs/Module/Match.php',
|
||||
'Zotlabs\\Module\\Menu' => __DIR__ . '/../..' . '/Zotlabs/Module/Menu.php',
|
||||
'Zotlabs\\Module\\Message' => __DIR__ . '/../..' . '/Zotlabs/Module/Message.php',
|
||||
'Zotlabs\\Module\\Mitem' => __DIR__ . '/../..' . '/Zotlabs/Module/Mitem.php',
|
||||
@ -583,10 +599,10 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
|
||||
'Zotlabs\\Module\\Oep' => __DIR__ . '/../..' . '/Zotlabs/Module/Oep.php',
|
||||
'Zotlabs\\Module\\Oexchange' => __DIR__ . '/../..' . '/Zotlabs/Module/Oexchange.php',
|
||||
'Zotlabs\\Module\\Online' => __DIR__ . '/../..' . '/Zotlabs/Module/Online.php',
|
||||
'Zotlabs\\Module\\Opensearch' => __DIR__ . '/../..' . '/Zotlabs/Module/Opensearch.php',
|
||||
'Zotlabs\\Module\\Page' => __DIR__ . '/../..' . '/Zotlabs/Module/Page.php',
|
||||
'Zotlabs\\Module\\Pconfig' => __DIR__ . '/../..' . '/Zotlabs/Module/Pconfig.php',
|
||||
'Zotlabs\\Module\\Pdledit' => __DIR__ . '/../..' . '/Zotlabs/Module/Pdledit.php',
|
||||
'Zotlabs\\Module\\Permcat' => __DIR__ . '/../..' . '/Zotlabs/Module/Permcat.php',
|
||||
'Zotlabs\\Module\\Photo' => __DIR__ . '/../..' . '/Zotlabs/Module/Photo.php',
|
||||
'Zotlabs\\Module\\Photos' => __DIR__ . '/../..' . '/Zotlabs/Module/Photos.php',
|
||||
'Zotlabs\\Module\\Ping' => __DIR__ . '/../..' . '/Zotlabs/Module/Ping.php',
|
||||
@ -616,7 +632,6 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
|
||||
'Zotlabs\\Module\\Removeme' => __DIR__ . '/../..' . '/Zotlabs/Module/Removeme.php',
|
||||
'Zotlabs\\Module\\Rmagic' => __DIR__ . '/../..' . '/Zotlabs/Module/Rmagic.php',
|
||||
'Zotlabs\\Module\\Rpost' => __DIR__ . '/../..' . '/Zotlabs/Module/Rpost.php',
|
||||
'Zotlabs\\Module\\Rsd_xml' => __DIR__ . '/../..' . '/Zotlabs/Module/Rsd_xml.php',
|
||||
'Zotlabs\\Module\\Search' => __DIR__ . '/../..' . '/Zotlabs/Module/Search.php',
|
||||
'Zotlabs\\Module\\Search_ac' => __DIR__ . '/../..' . '/Zotlabs/Module/Search_ac.php',
|
||||
'Zotlabs\\Module\\Service_limits' => __DIR__ . '/../..' . '/Zotlabs/Module/Service_limits.php',
|
||||
@ -627,6 +642,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
|
||||
'Zotlabs\\Module\\Settings\\Featured' => __DIR__ . '/../..' . '/Zotlabs/Module/Settings/Featured.php',
|
||||
'Zotlabs\\Module\\Settings\\Features' => __DIR__ . '/../..' . '/Zotlabs/Module/Settings/Features.php',
|
||||
'Zotlabs\\Module\\Settings\\Oauth' => __DIR__ . '/../..' . '/Zotlabs/Module/Settings/Oauth.php',
|
||||
'Zotlabs\\Module\\Settings\\Permcats' => __DIR__ . '/../..' . '/Zotlabs/Module/Settings/Permcats.php',
|
||||
'Zotlabs\\Module\\Settings\\Tokens' => __DIR__ . '/../..' . '/Zotlabs/Module/Settings/Tokens.php',
|
||||
'Zotlabs\\Module\\Setup' => __DIR__ . '/../..' . '/Zotlabs/Module/Setup.php',
|
||||
'Zotlabs\\Module\\Share' => __DIR__ . '/../..' . '/Zotlabs/Module/Share.php',
|
||||
@ -687,6 +703,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
|
||||
'Zotlabs\\Text\\Tagadelic' => __DIR__ . '/../..' . '/Zotlabs/Text/Tagadelic.php',
|
||||
'Zotlabs\\Web\\CheckJS' => __DIR__ . '/../..' . '/Zotlabs/Web/CheckJS.php',
|
||||
'Zotlabs\\Web\\Controller' => __DIR__ . '/../..' . '/Zotlabs/Web/Controller.php',
|
||||
'Zotlabs\\Web\\HTTPHeaders' => __DIR__ . '/../..' . '/Zotlabs/Web/HTTPHeaders.php',
|
||||
'Zotlabs\\Web\\HttpMeta' => __DIR__ . '/../..' . '/Zotlabs/Web/HttpMeta.php',
|
||||
'Zotlabs\\Web\\Router' => __DIR__ . '/../..' . '/Zotlabs/Web/Router.php',
|
||||
'Zotlabs\\Web\\Session' => __DIR__ . '/../..' . '/Zotlabs/Web/Session.php',
|
||||
@ -707,6 +724,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d::$prefixDirsPsr4;
|
||||
$loader->prefixesPsr0 = ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d::$prefixesPsr0;
|
||||
$loader->classMap = ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
|
67
vendor/composer/installed.json
vendored
67
vendor/composer/installed.json
vendored
@ -21,7 +21,7 @@
|
||||
"phpunit/phpunit": "*",
|
||||
"sabre/cs": "~0.0.1"
|
||||
},
|
||||
"time": "2016-03-08 02:29:27",
|
||||
"time": "2016-03-08T02:29:27+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -79,7 +79,7 @@
|
||||
"suggest": {
|
||||
"hoa/bench": "If you would like to run the benchmark scripts"
|
||||
},
|
||||
"time": "2016-07-15 19:52:17",
|
||||
"time": "2016-07-15T19:52:17+00:00",
|
||||
"bin": [
|
||||
"bin/vobject",
|
||||
"bin/generate_vcards"
|
||||
@ -173,7 +173,7 @@
|
||||
"phpunit/phpunit": "*",
|
||||
"sabre/cs": "~0.0.4"
|
||||
},
|
||||
"time": "2015-11-05 20:14:39",
|
||||
"time": "2015-11-05T20:14:39+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -238,7 +238,7 @@
|
||||
"suggest": {
|
||||
"ext-curl": " to make http requests with the Client class"
|
||||
},
|
||||
"time": "2016-01-06 23:00:08",
|
||||
"time": "2016-01-06T23:00:08+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -310,7 +310,7 @@
|
||||
"ext-curl": "*",
|
||||
"ext-pdo": "*"
|
||||
},
|
||||
"time": "2016-06-28 02:44:05",
|
||||
"time": "2016-06-28T02:44:05+00:00",
|
||||
"bin": [
|
||||
"bin/sabredav",
|
||||
"bin/naturalselection"
|
||||
@ -379,7 +379,7 @@
|
||||
"phpunit/phpunit": "*",
|
||||
"sabre/cs": "~1.0.0"
|
||||
},
|
||||
"time": "2016-10-09 22:57:52",
|
||||
"time": "2016-10-09T22:57:52+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -435,7 +435,7 @@
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"time": "2016-10-10 12:19:37",
|
||||
"time": "2016-10-10T12:19:37+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
@ -465,5 +465,58 @@
|
||||
"psr",
|
||||
"psr-3"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "michelf/php-markdown",
|
||||
"version": "1.7.0",
|
||||
"version_normalized": "1.7.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/michelf/php-markdown.git",
|
||||
"reference": "1f51cc520948f66cd2af8cbc45a5ee175e774220"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/michelf/php-markdown/zipball/1f51cc520948f66cd2af8cbc45a5ee175e774220",
|
||||
"reference": "1f51cc520948f66cd2af8cbc45a5ee175e774220",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"time": "2016-10-29T18:58:20+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-lib": "1.4.x-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Michelf": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Michel Fortin",
|
||||
"email": "michel.fortin@michelf.ca",
|
||||
"homepage": "https://michelf.ca/",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "John Gruber",
|
||||
"homepage": "https://daringfireball.net/"
|
||||
}
|
||||
],
|
||||
"description": "PHP Markdown",
|
||||
"homepage": "https://michelf.ca/projects/php-markdown/",
|
||||
"keywords": [
|
||||
"markdown"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
36
vendor/michelf/php-markdown/License.md
vendored
Normal file
36
vendor/michelf/php-markdown/License.md
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
PHP Markdown Lib
|
||||
Copyright (c) 2004-2016 Michel Fortin
|
||||
<https://michelf.ca/>
|
||||
All rights reserved.
|
||||
|
||||
Based on Markdown
|
||||
Copyright (c) 2003-2006 John Gruber
|
||||
<https://daringfireball.net/>
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name "Markdown" nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
This software is provided by the copyright holders and contributors "as
|
||||
is" and any express or implied warranties, including, but not limited
|
||||
to, the implied warranties of merchantability and fitness for a
|
||||
particular purpose are disclaimed. In no event shall the copyright owner
|
||||
or contributors be liable for any direct, indirect, incidental, special,
|
||||
exemplary, or consequential damages (including, but not limited to,
|
||||
procurement of substitute goods or services; loss of use, data, or
|
||||
profits; or business interruption) however caused and on any theory of
|
||||
liability, whether in contract, strict liability, or tort (including
|
||||
negligence or otherwise) arising in any way out of the use of this
|
||||
software, even if advised of the possibility of such damage.
|
10
vendor/michelf/php-markdown/Michelf/Markdown.inc.php
vendored
Normal file
10
vendor/michelf/php-markdown/Michelf/Markdown.inc.php
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
// Use this file if you cannot use class autoloading. It will include all the
|
||||
// files needed for the Markdown parser.
|
||||
//
|
||||
// Take a look at the PSR-0-compatible class autoloading implementation
|
||||
// in the Readme.php file if you want a simple autoloader setup.
|
||||
|
||||
require_once dirname(__FILE__) . '/MarkdownInterface.php';
|
||||
require_once dirname(__FILE__) . '/Markdown.php';
|
1896
vendor/michelf/php-markdown/Michelf/Markdown.php
vendored
Normal file
1896
vendor/michelf/php-markdown/Michelf/Markdown.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
11
vendor/michelf/php-markdown/Michelf/MarkdownExtra.inc.php
vendored
Normal file
11
vendor/michelf/php-markdown/Michelf/MarkdownExtra.inc.php
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
// Use this file if you cannot use class autoloading. It will include all the
|
||||
// files needed for the MarkdownExtra parser.
|
||||
//
|
||||
// Take a look at the PSR-0-compatible class autoloading implementation
|
||||
// in the Readme.php file if you want a simple autoloader setup.
|
||||
|
||||
require_once dirname(__FILE__) . '/MarkdownInterface.php';
|
||||
require_once dirname(__FILE__) . '/Markdown.php';
|
||||
require_once dirname(__FILE__) . '/MarkdownExtra.php';
|
1785
vendor/michelf/php-markdown/Michelf/MarkdownExtra.php
vendored
Normal file
1785
vendor/michelf/php-markdown/Michelf/MarkdownExtra.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
9
vendor/michelf/php-markdown/Michelf/MarkdownInterface.inc.php
vendored
Normal file
9
vendor/michelf/php-markdown/Michelf/MarkdownInterface.inc.php
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
// Use this file if you cannot use class autoloading. It will include all the
|
||||
// files needed for the MarkdownInterface interface.
|
||||
//
|
||||
// Take a look at the PSR-0-compatible class autoloading implementation
|
||||
// in the Readme.php file if you want a simple autoloader setup.
|
||||
|
||||
require_once dirname(__FILE__) . '/MarkdownInterface.php';
|
38
vendor/michelf/php-markdown/Michelf/MarkdownInterface.php
vendored
Normal file
38
vendor/michelf/php-markdown/Michelf/MarkdownInterface.php
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Markdown - A text-to-HTML conversion tool for web writers
|
||||
*
|
||||
* @package php-markdown
|
||||
* @author Michel Fortin <michel.fortin@michelf.com>
|
||||
* @copyright 2004-2016 Michel Fortin <https://michelf.com/projects/php-markdown/>
|
||||
* @copyright (Original Markdown) 2004-2006 John Gruber <https://daringfireball.net/projects/markdown/>
|
||||
*/
|
||||
|
||||
namespace Michelf;
|
||||
|
||||
/**
|
||||
* Markdown Parser Interface
|
||||
*/
|
||||
interface MarkdownInterface {
|
||||
/**
|
||||
* Initialize the parser and return the result of its transform method.
|
||||
* This will work fine for derived classes too.
|
||||
*
|
||||
* @api
|
||||
*
|
||||
* @param string $text
|
||||
* @return string
|
||||
*/
|
||||
public static function defaultTransform($text);
|
||||
|
||||
/**
|
||||
* Main function. Performs some preprocessing on the input text
|
||||
* and pass it through the document gamut.
|
||||
*
|
||||
* @api
|
||||
*
|
||||
* @param string $text
|
||||
* @return string
|
||||
*/
|
||||
public function transform($text);
|
||||
}
|
384
vendor/michelf/php-markdown/Readme.md
vendored
Normal file
384
vendor/michelf/php-markdown/Readme.md
vendored
Normal file
@ -0,0 +1,384 @@
|
||||
PHP Markdown
|
||||
============
|
||||
|
||||
PHP Markdown Lib 1.7.0 - 29 Oct 2016
|
||||
|
||||
by Michel Fortin
|
||||
<https://michelf.ca/>
|
||||
|
||||
based on Markdown by John Gruber
|
||||
<https://daringfireball.net/>
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
This is a library package that includes the PHP Markdown parser and its
|
||||
sibling PHP Markdown Extra with additional features.
|
||||
|
||||
Markdown is a text-to-HTML conversion tool for web writers. Markdown
|
||||
allows you to write using an easy-to-read, easy-to-write plain text
|
||||
format, then convert it to structurally valid XHTML (or HTML).
|
||||
|
||||
"Markdown" is actually two things: a plain text markup syntax, and a
|
||||
software tool, originally written in Perl, that converts the plain text
|
||||
markup to HTML. PHP Markdown is a port to PHP of the original Markdown
|
||||
program by John Gruber.
|
||||
|
||||
* [Full documentation of the Markdown syntax](<https://daringfireball.net/projects/markdown/>)
|
||||
— Daring Fireball (John Gruber)
|
||||
* [Markdown Extra syntax additions](<https://michelf.ca/projects/php-markdown/extra/>)
|
||||
— Michel Fortin
|
||||
|
||||
|
||||
Requirement
|
||||
-----------
|
||||
|
||||
This library package requires PHP 5.3 or later.
|
||||
|
||||
Note: The older plugin/library hybrid package for PHP Markdown and
|
||||
PHP Markdown Extra is still maintained and will work with PHP 4.0.5 and later.
|
||||
|
||||
Before PHP 5.3.7, pcre.backtrack_limit defaults to 100 000, which is too small
|
||||
in many situations. You might need to set it to higher values. Later PHP
|
||||
releases defaults to 1 000 000, which is usually fine.
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
This library package is meant to be used with class autoloading. For autoloading
|
||||
to work, your project needs have setup a PSR-0-compatible autoloader. See the
|
||||
included Readme.php file for a minimal autoloader setup. (If you cannot use
|
||||
autoloading, see below.)
|
||||
|
||||
With class autoloading in place, putting the 'Michelf' folder in your
|
||||
include path should be enough for this to work:
|
||||
|
||||
use \Michelf\Markdown;
|
||||
$my_html = Markdown::defaultTransform($my_text);
|
||||
|
||||
Markdown Extra syntax is also available the same way:
|
||||
|
||||
use \Michelf\MarkdownExtra;
|
||||
$my_html = MarkdownExtra::defaultTransform($my_text);
|
||||
|
||||
If you wish to use PHP Markdown with another text filter function
|
||||
built to parse HTML, you should filter the text *after* the `transform`
|
||||
function call. This is an example with [PHP SmartyPants][psp]:
|
||||
|
||||
use \Michelf\Markdown, \Michelf\SmartyPants;
|
||||
$my_html = Markdown::defaultTransform($my_text);
|
||||
$my_html = SmartyPants::defaultTransform($my_html);
|
||||
|
||||
All these examples are using the static `defaultTransform` static function
|
||||
found inside the parser class. If you want to customize the parser
|
||||
configuration, you can also instantiate it directly and change some
|
||||
configuration variables:
|
||||
|
||||
use \Michelf\MarkdownExtra;
|
||||
$parser = new MarkdownExtra;
|
||||
$parser->fn_id_prefix = "post22-";
|
||||
$my_html = $parser->transform($my_text);
|
||||
|
||||
To learn more, see the full list of [configuration variables].
|
||||
|
||||
[configuration variables]: https://michelf.ca/projects/php-markdown/configuration/
|
||||
|
||||
|
||||
### Usage without an autoloader
|
||||
|
||||
If you cannot use class autoloading, you can still use `include` or `require`
|
||||
to access the parser. To load the `\Michelf\Markdown` parser, do it this way:
|
||||
|
||||
require_once 'Michelf/Markdown.inc.php';
|
||||
|
||||
Or, if you need the `\Michelf\MarkdownExtra` parser:
|
||||
|
||||
require_once 'Michelf/MarkdownExtra.inc.php';
|
||||
|
||||
While the plain `.php` files depend on autoloading to work correctly, using the
|
||||
`.inc.php` files instead will eagerly load the dependencies that would be
|
||||
loaded on demand if you were using autoloading.
|
||||
|
||||
|
||||
Public API and Versioning Policy
|
||||
---------------------------------
|
||||
|
||||
Version numbers are of the form *major*.*minor*.*patch*.
|
||||
|
||||
The public API of PHP Markdown consist of the two parser classes `Markdown`
|
||||
and `MarkdownExtra`, their constructors, the `transform` and `defaultTransform`
|
||||
functions and their configuration variables. The public API is stable for
|
||||
a given major version number. It might get additions when the minor version
|
||||
number increments.
|
||||
|
||||
**Protected members are not considered public API.** This is unconventional
|
||||
and deserves an explanation. Incrementing the major version number every time
|
||||
the underlying implementation of something changes is going to give
|
||||
nonessential version numbers for the vast majority of people who just use the
|
||||
parser. Protected members are meant to create parser subclasses that behave in
|
||||
different ways. Very few people create parser subclasses. I don't want to
|
||||
discourage it by making everything private, but at the same time I can't
|
||||
guarantee any stable hook between versions if you use protected members.
|
||||
|
||||
**Syntax changes** will increment the minor number for new features, and the
|
||||
patch number for small corrections. A *new feature* is something that needs a
|
||||
change in the syntax documentation. Note that since PHP Markdown Lib includes
|
||||
two parsers, a syntax change for either of them will increment the minor
|
||||
number. Also note that there is nothing perfectly backward-compatible with the
|
||||
Markdown syntax: all inputs are always valid, so new features always replace
|
||||
something that was previously legal, although generally nonsensical to do.
|
||||
|
||||
|
||||
Bugs
|
||||
----
|
||||
|
||||
To file bug reports please send email to:
|
||||
<michel.fortin@michelf.ca>
|
||||
|
||||
Please include with your report: (1) the example input; (2) the output you
|
||||
expected; (3) the output PHP Markdown actually produced.
|
||||
|
||||
If you have a problem where Markdown gives you an empty result, first check
|
||||
that the backtrack limit is not too low by running `php --info | grep pcre`.
|
||||
See Installation and Requirement above for details.
|
||||
|
||||
|
||||
Development and Testing
|
||||
-----------------------
|
||||
|
||||
Pull requests for fixing bugs are welcome. Proposed new features are
|
||||
going to be meticulously reviewed -- taking into account backward compatibility,
|
||||
potential side effects, and future extensibility -- before deciding on
|
||||
acceptance or rejection.
|
||||
|
||||
If you make a pull request that includes changes to the parser please add
|
||||
tests for what is being changed to [MDTest][] and make a pull request there
|
||||
too.
|
||||
|
||||
[MDTest]: https://github.com/michelf/mdtest/
|
||||
|
||||
|
||||
Donations
|
||||
---------
|
||||
|
||||
If you wish to make a donation that will help me devote more time to
|
||||
PHP Markdown, please visit [michelf.ca/donate] or send Bitcoin to
|
||||
[1HiuX34czvVPPdhXbUAsAu7pZcesniDCGH].
|
||||
|
||||
[michelf.ca/donate]: https://michelf.ca/donate/#!Thanks%20for%20PHP%20Markdown
|
||||
[1HiuX34czvVPPdhXbUAsAu7pZcesniDCGH]: bitcoin:1HiuX34czvVPPdhXbUAsAu7pZcesniDCGH
|
||||
|
||||
|
||||
Version History
|
||||
---------------
|
||||
|
||||
PHP Markdown Lib 1.7.0 (29 Oct 2016)
|
||||
|
||||
* Added a `hard_wrap` configuration variable to make all newline characters
|
||||
in the text become `<br>` tags in the HTML output. By default, according
|
||||
to the standard Markdown syntax these newlines are ignored unless they a
|
||||
preceded by two spaces. Thanks to Jonathan Cohlmeyer for the implementation.
|
||||
|
||||
* Improved the parsing of list items to fix problematic cases that came to
|
||||
light with the addition of `hard_wrap`. This should have no effect on the
|
||||
output except span-level list items that ended with two spaces (and thus
|
||||
ended with a line break).
|
||||
|
||||
* Added a `code_span_content_func` configuration variable which takes a
|
||||
function that will convert the content of the code span to HTML. This can
|
||||
be useful to implement syntax highlighting. Although contrary to its
|
||||
code block equivalent, there is no syntax for specifying a language.
|
||||
Credits to styxit for the implementation.
|
||||
|
||||
* Fixed a Markdwon Extra issue where two-space-at-end-of-line hard breaks
|
||||
wouldn't work inside of HTML block elements such as `<p markdown="1">`
|
||||
where the element expects only span-level content.
|
||||
|
||||
* In the parser code, switched to PHPDoc comment format. Thanks to
|
||||
Robbie Averill for the help.
|
||||
|
||||
|
||||
PHP Markdown Lib 1.6.0 (23 Dec 2015)
|
||||
|
||||
Note: this version was incorrectly released as 1.5.1 on Dec 22, a number
|
||||
that contradicted the versioning policy.
|
||||
|
||||
* For fenced code blocks in Markdown Extra, can now set a class name for the
|
||||
code block's language before the special attribute block. Previously, this
|
||||
class name was only allowed in the absence of the special attribute block.
|
||||
|
||||
* Added a `code_block_content_func` configuration variable which takes a
|
||||
function that will convert the content of the code block to HTML. This is
|
||||
most useful for syntax highlighting. For fenced code blocks in Markdown
|
||||
Extra, the function has access to the language class name (the one outside
|
||||
of the special attribute block). Credits to Mario Konrad for providing the
|
||||
implementation.
|
||||
|
||||
* The curled arrow character for the backlink in footnotes is now followed
|
||||
by a Unicode variant selector to prevent it from being displayed in emoji
|
||||
form on iOS.
|
||||
|
||||
Note that in older browsers the variant selector is often interpreted as a
|
||||
separate character, making it visible after the arrow. So there is now a
|
||||
also a `fn_backlink_html` configuration variable that can be used to set
|
||||
the link text to something else. Credits to Dana for providing the
|
||||
implementation.
|
||||
|
||||
* Fixed an issue in MarkdownExtra where long header lines followed by a
|
||||
special attribute block would hit the backtrack limit an cause an empty
|
||||
string to be returned.
|
||||
|
||||
|
||||
PHP Markdown Lib 1.5.0 (1 Mar 2015)
|
||||
|
||||
* Added the ability start ordered lists with a number different from 1 and
|
||||
and have that reflected in the HTML output. This can be enabled with
|
||||
the `enhanced_ordered_lists` configuration variable for the Markdown
|
||||
parser; it is enabled by default for Markdown Extra.
|
||||
Credits to Matt Gorle for providing the implementation.
|
||||
|
||||
* Added the ability to insert custom HTML attributes with simple values
|
||||
everywhere an extra attribute block is allowed (links, images, headers).
|
||||
The value must be unquoted, cannot contains spaces and is limited to
|
||||
alphanumeric ASCII characters.
|
||||
Credits to Peter Droogmans for providing the implementation.
|
||||
|
||||
* Added a `header_id_func` configuration variable which takes a function
|
||||
that can generate an `id` attribute value from the header text.
|
||||
Credits to Evert Pot 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)
|
||||
|
||||
* The HTML block parser will now treat `<figure>` as a block-level element
|
||||
(as it should) and no longer wrap it in `<p>` or parse it's content with
|
||||
the as Markdown syntax (although with Extra you can use `markdown="1"`
|
||||
if you wish to use the Markdown syntax inside it).
|
||||
|
||||
* The content of `<style>` elements will now be left alone, its content
|
||||
won't be interpreted as Markdown.
|
||||
|
||||
* Corrected an bug where some inline links with spaces in them would not
|
||||
work even when surounded with angle brackets:
|
||||
|
||||
[link](<s p a c e s>)
|
||||
|
||||
* Fixed an issue where email addresses with quotes in them would not always
|
||||
have the quotes escaped in the link attribute, causing broken links (and
|
||||
invalid HTML).
|
||||
|
||||
* Fixed the case were a link definition following a footnote definition would
|
||||
be swallowed by the footnote unless it was separated by a blank line.
|
||||
|
||||
|
||||
PHP Markdown Lib 1.4.0 (29 Nov 2013)
|
||||
|
||||
* Added support for the `tel:` URL scheme in automatic links.
|
||||
|
||||
<tel:+1-111-111-1111>
|
||||
|
||||
It gets converted to this (note the `tel:` prefix becomes invisible):
|
||||
|
||||
<a href="tel:+1-111-111-1111">+1-111-111-1111</a>
|
||||
|
||||
* Added backtick fenced code blocks to MarkdownExtra, originally from
|
||||
Github-Flavored Markdown.
|
||||
|
||||
* Added an interface called MarkdownInterface implemented by both
|
||||
the Markdown and MarkdownExtra parsers. You can use the interface if
|
||||
you want to create a mockup parser object for unit testing.
|
||||
|
||||
* For those of you who cannot use class autoloading, you can now
|
||||
include `Michelf/Markdown.inc.php` or `Michelf/MarkdownExtra.inc.php` (note
|
||||
the `.inc.php` extension) to automatically include other files required
|
||||
by the parser.
|
||||
|
||||
|
||||
PHP Markdown Lib 1.3 (11 Apr 2013)
|
||||
|
||||
This is the first release of PHP Markdown Lib. This package requires PHP
|
||||
version 5.3 or later and is designed to work with PSR-0 autoloading and,
|
||||
optionally with Composer. Here is a list of the changes since
|
||||
PHP Markdown Extra 1.2.6:
|
||||
|
||||
* Plugin interface for WordPress and other systems is no longer present in
|
||||
the Lib package. The classic package is still available if you need it:
|
||||
<https://michelf.ca/projects/php-markdown/classic/>
|
||||
|
||||
* Added `public` and `protected` protection attributes, plus a section about
|
||||
what is "public API" and what isn't in the Readme file.
|
||||
|
||||
* Changed HTML output for footnotes: now instead of adding `rel` and `rev`
|
||||
attributes, footnotes links have the class name `footnote-ref` and
|
||||
backlinks `footnote-backref`.
|
||||
|
||||
* Fixed some regular expressions to make PCRE not shout warnings about POSIX
|
||||
collation classes (dependent on your version of PCRE).
|
||||
|
||||
* Added optional class and id attributes to images and links using the same
|
||||
syntax as for headers:
|
||||
|
||||
[link](url){#id .class}
|
||||
{#id .class}
|
||||
|
||||
It work too for reference-style links and images. In this case you need
|
||||
to put those attributes at the reference definition:
|
||||
|
||||
[link][linkref] or [linkref]
|
||||
![img][linkref]
|
||||
|
||||
[linkref]: url "optional title" {#id .class}
|
||||
|
||||
* Fixed a PHP notice message triggered when some table column separator
|
||||
markers are missing on the separator line below column headers.
|
||||
|
||||
* Fixed a small mistake that could cause the parser to retain an invalid
|
||||
state related to parsing links across multiple runs. This was never
|
||||
observed (that I know of), but it's still worth fixing.
|
||||
|
||||
|
||||
Copyright and License
|
||||
---------------------
|
||||
|
||||
PHP Markdown Lib
|
||||
Copyright (c) 2004-2016 Michel Fortin
|
||||
<https://michelf.ca/>
|
||||
All rights reserved.
|
||||
|
||||
Based on Markdown
|
||||
Copyright (c) 2003-2005 John Gruber
|
||||
<https://daringfireball.net/>
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
* Neither the name "Markdown" nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
This software is provided by the copyright holders and contributors "as
|
||||
is" and any express or implied warranties, including, but not limited
|
||||
to, the implied warranties of merchantability and fitness for a
|
||||
particular purpose are disclaimed. In no event shall the copyright owner
|
||||
or contributors be liable for any direct, indirect, incidental, special,
|
||||
exemplary, or consequential damages (including, but not limited to,
|
||||
procurement of substitute goods or services; loss of use, data, or
|
||||
profits; or business interruption) however caused and on any theory of
|
||||
liability, whether in contract, strict liability, or tort (including
|
||||
negligence or otherwise) arising in any way out of the use of this
|
||||
software, even if advised of the possibility of such damage.
|
31
vendor/michelf/php-markdown/Readme.php
vendored
Normal file
31
vendor/michelf/php-markdown/Readme.php
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
// This file passes the content of the Readme.md file in the same directory
|
||||
// through the Markdown filter. You can adapt this sample code in any way
|
||||
// you like.
|
||||
|
||||
// Install PSR-0-compatible class autoloader
|
||||
spl_autoload_register(function($class){
|
||||
require preg_replace('{\\\\|_(?!.*\\\\)}', DIRECTORY_SEPARATOR, ltrim($class, '\\')).'.php';
|
||||
});
|
||||
|
||||
// Get Markdown class
|
||||
use \Michelf\Markdown;
|
||||
|
||||
// Read file and pass content through the Markdown parser
|
||||
$text = file_get_contents('Readme.md');
|
||||
$html = Markdown::defaultTransform($text);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>PHP Markdown Lib - Readme</title>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
// Put HTML content in the document
|
||||
echo $html;
|
||||
?>
|
||||
</body>
|
||||
</html>
|
31
vendor/michelf/php-markdown/composer.json
vendored
Normal file
31
vendor/michelf/php-markdown/composer.json
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "michelf/php-markdown",
|
||||
"type": "library",
|
||||
"description": "PHP Markdown",
|
||||
"homepage": "https://michelf.ca/projects/php-markdown/",
|
||||
"keywords": ["markdown"],
|
||||
"license": "BSD-3-Clause",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Michel Fortin",
|
||||
"email": "michel.fortin@michelf.ca",
|
||||
"homepage": "https://michelf.ca/",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "John Gruber",
|
||||
"homepage": "https://daringfireball.net/"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": { "Michelf": "" }
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-lib": "1.4.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user