aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2020-09-22 22:18:33 +0200
committerLaria Carolin Chabowski <laria@laria.me>2020-09-22 22:18:33 +0200
commitd6774a94d223f0e87a9f0aab02f4de05deada86f (patch)
treefa92604a7671f57b16ee59f540af8868a44d16a3
parentdc6f7089c053a4f96e713bdf0043f5c08dbae447 (diff)
downloadratatoeskr-cms-d6774a94d223f0e87a9f0aab02f4de05deada86f.tar.gz
ratatoeskr-cms-d6774a94d223f0e87a9f0aab02f4de05deada86f.tar.bz2
ratatoeskr-cms-d6774a94d223f0e87a9f0aab02f4de05deada86f.zip
Get php-markdown via composer
-rw-r--r--.gitignore1
-rw-r--r--INSTALL.md10
-rwxr-xr-xbuild.sh6
-rw-r--r--composer.json3
-rw-r--r--composer.lock51
-rw-r--r--ratatoeskr/libs/INFO10
-rw-r--r--ratatoeskr/sys/textprocessors.php5
-rw-r--r--setup.php1
8 files changed, 59 insertions, 28 deletions
diff --git a/.gitignore b/.gitignore
index 383163b..c04d68f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,7 +6,6 @@ ratatoeskr/templates/src/plugintemplates/*
ratatoeskr/templates/src/usertemplates/*
ratatoeskr/templates/transc/*
ratatoeskr/libs/ste
-ratatoeskr/libs/markdown.php
ratatoeskr/libs/kses.php
ratatoeskr/libs/jquery.min.js
ratatoeskr/config.php
diff --git a/INSTALL.md b/INSTALL.md
index ff57a80..e9be995 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -20,19 +20,13 @@ Step 2: Get additional libraries
You need these libraries to run Ratatöskr (it is probably already bundled with these):
-1. PHP Markdown
-
- Place "markdown.php" from the archive directly into this directory.
-
- PHP Markdown can be found here: <http://michelf.com/projects/php-markdown/>
-
-2. kses
+1. kses
Place "kses.php" from the archive directly into this directory.
kses can be found at <http://sourceforge.net/projects/kses/>
-3. jQuery
+2. jQuery
Place jquery.min.js into this folder.
diff --git a/build.sh b/build.sh
index 8a6bbcd..7e3389d 100755
--- a/build.sh
+++ b/build.sh
@@ -18,12 +18,6 @@ install_dependencies() {
cd ratatoeskr/libs
- wget http://michelf.com/docs/projets/php-markdown-1.0.1o.zip
- unzip php-markdown-*.zip
- mv PHP\ Markdown\ */markdown.php .
- rm -rf PHP\ Markdown\ *
- rm php-markdown-*.zip
-
wget -O kses.zip http://sourceforge.net/projects/kses/files/kses/0.2.2/kses-0.2.2.zip/download?use_mirror=optimate
unzip kses.zip
mv kses-*/kses.php .
diff --git a/composer.json b/composer.json
index f2c4b37..fed18c1 100644
--- a/composer.json
+++ b/composer.json
@@ -16,7 +16,8 @@
"type": "project",
"require": {
"php": ">=7.3",
- "r7r/ste": "^2.0.1"
+ "r7r/ste": "^2.0.1",
+ "michelf/php-markdown": "^1.9"
},
"config": {
"vendor-dir": "ratatoeskr/vendor"
diff --git a/composer.lock b/composer.lock
index 7dda3d4..7e40506 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,9 +4,58 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "ae4ab914ba9041a5c34281d8b34f769d",
+ "content-hash": "b24fa722b1b134feabc31603beda3933",
"packages": [
{
+ "name": "michelf/php-markdown",
+ "version": "1.9.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/michelf/php-markdown.git",
+ "reference": "c83178d49e372ca967d1a8c77ae4e051b3a3c75c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/michelf/php-markdown/zipball/c83178d49e372ca967d1a8c77ae4e051b3a3c75c",
+ "reference": "c83178d49e372ca967d1a8c77ae4e051b3a3c75c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": ">=4.3 <5.8"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Michelf\\": "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"
+ ],
+ "time": "2019-12-02T02:32:27+00:00"
+ },
+ {
"name": "r7r/ste",
"version": "2.0.1",
"source": {
diff --git a/ratatoeskr/libs/INFO b/ratatoeskr/libs/INFO
index 80a47e3..f1ef415 100644
--- a/ratatoeskr/libs/INFO
+++ b/ratatoeskr/libs/INFO
@@ -1,18 +1,12 @@
This directory will hold some libraries Ratatöskr needs.
-1. PHP Markdown
-
- Place "markdown.php" from the archive directly into this directory.
-
- PHP Markdown can be found here: <http://michelf.com/projects/php-markdown/>
-
-2. kses
+1. kses
Place "kses.php" from the archive directly into this directory.
kses can be found at <http://sourceforge.net/projects/kses/>
-3. jQuery
+2. jQuery
Place jquery.min.js into this folder.
diff --git a/ratatoeskr/sys/textprocessors.php b/ratatoeskr/sys/textprocessors.php
index 7ff3bbb..f195ef7 100644
--- a/ratatoeskr/sys/textprocessors.php
+++ b/ratatoeskr/sys/textprocessors.php
@@ -9,7 +9,8 @@
* See "ratatoeskr/licenses/ratatoeskr" for more information.
*/
-require_once(dirname(__FILE__) . "/../libs/markdown.php");
+use Michelf\Markdown;
+
require_once(dirname(__FILE__) . "/utils.php");
/*
@@ -70,7 +71,7 @@ function textprocessor_apply_translation($translationobj)
if (!isset($textprocessors)) {
$textprocessors = [
- "Markdown" => ["Markdown", true],
+ "Markdown" => [Closure::fromCallable([Markdown::class, "defaultTransform"]), true],
"Plain Text" => [function ($text) {
return str_replace(["\r\n", "\n"], ["<br />", "<br />"], htmlesc($text));
}, true],
diff --git a/setup.php b/setup.php
index cbb58f4..2f57ce9 100644
--- a/setup.php
+++ b/setup.php
@@ -59,7 +59,6 @@ $files = [
"/ratatoeskr/translations/de.php",
"/ratatoeskr/translations/en.php",
"/ratatoeskr/backend.php",
- "/ratatoeskr/libs/markdown.php",
"/ratatoeskr/libs/kses.php",
"/ratatoeskr/vendor/autoload.php",
"/ratatoeskr/.htaccess",