diff --git a/composer.json b/composer.json index 0233b772ff..28b6ec2255 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,6 @@ "checkdomain/holiday": "^3.0.0", "gregwar/captcha": "^1.0", "guzzlehttp/guzzle": "^7.2", - "michelf/php-markdown": "^2.0", "monolog/monolog": "^2.0", "openpsa/installer": "^1.0", "openpsa/midgard-portable": "^1.10.0", @@ -55,7 +54,8 @@ "symfony/validator": ">=6.4", "symfony/var-dumper": ">=6.4", "symfony/yaml": ">=6.4", - "cocur/slugify": "^4.0" + "cocur/slugify": "^4.0", + "erusev/parsedown": "^1.8" }, "scripts": { "post-install-cmd": [ diff --git a/lib/midcom/admin/help/help.php b/lib/midcom/admin/help/help.php index 312746c05f..9ecc5fa9cf 100644 --- a/lib/midcom/admin/help/help.php +++ b/lib/midcom/admin/help/help.php @@ -6,7 +6,6 @@ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License */ -use Michelf\MarkdownExtra; use midgard\portable\storage\connection; /** @@ -95,7 +94,8 @@ private function _load_file(string $help_id, string $component) : ?string public function get_help_contents(string $help_id, string $component) : ?string { if ($text = $this->_load_file($help_id, $component)) { - return MarkdownExtra::defaultTransform($text); + $parsedown = new Parsedown(); + return $parsedown->text($text); } return null; } diff --git a/lib/midcom/documentation/05_editing_elements.en.txt b/lib/midcom/documentation/05_editing_elements.en.txt index 7a104a18f8..8a9612cbd7 100644 --- a/lib/midcom/documentation/05_editing_elements.en.txt +++ b/lib/midcom/documentation/05_editing_elements.en.txt @@ -172,16 +172,16 @@ from the right-click context menu: Depending on the level of action (single cell/table row/whole table), select the corresponding action. * Table properties for affecting the whole table - * choose eg. the horizontal Alignment, Border width and table dimensions (Width and Height) + * choose eg. the horizontal Alignment, Border width and table dimensions (Width and Height) * Table row properties for affecting the selected rows - * choose whether the rows represent table body, head or foot - * general alignments - * with Table row properties it is also possible to change either the currently selected rows, all the + * choose whether the rows represent table body, head or foot + * general alignments + * with Table row properties it is also possible to change either the currently selected rows, all the rows or all the odd/even rows of the table * Table cell properties for individual table cells - * cell specific alignments and Cell type - * cell dimensions (Width and Height) - * with Table cell properties it is also possible to change either the currently selected cells, all the + * cell specific alignments and Cell type + * cell dimensions (Width and Height) + * with Table cell properties it is also possible to change either the currently selected cells, all the cells on the currently selected rows or every cell in the table >Note: Many of the actions for cells and rows are the same, although some functionalities @@ -211,9 +211,9 @@ appear a popup window. Other functionalities of the image popup are * Replace file - * replace a file that is currently on the server eg. after changes + * replace a file that is currently on the server eg. after changes * Delete file - * delete a file from the server + * delete a file from the server >Note: If you are using the same image many times eg. in the same folder (but not the same >article) you can also attach the image to the folder instead of the currently edited page. To @@ -224,9 +224,9 @@ To change the image size * Click on the image * There are white boxes in each of the corners and in the middle of each side - * to change the proportional size click and drag from a corner - * to change the horizontal size click and drag from the sides - * to change the vertical size click and drag from the top or bottom + * to change the proportional size click and drag from a corner + * to change the horizontal size click and drag from the sides + * to change the vertical size click and drag from the top or bottom ###Image properties diff --git a/lib/net/nemein/wiki/documentation/markdown.en.txt b/lib/net/nemein/wiki/documentation/markdown.en.txt index dffc488475..bbe9af9b13 100644 --- a/lib/net/nemein/wiki/documentation/markdown.en.txt +++ b/lib/net/nemein/wiki/documentation/markdown.en.txt @@ -31,7 +31,7 @@ Markdown: Syntax * [Automatic Links](#autolink) -* * * +---

Overview

diff --git a/lib/net/nemein/wiki/parser.php b/lib/net/nemein/wiki/parser.php index 1fe908949e..95f5587dae 100644 --- a/lib/net/nemein/wiki/parser.php +++ b/lib/net/nemein/wiki/parser.php @@ -6,8 +6,6 @@ * @license http://www.gnu.org/licenses/gpl.html GNU General Public License */ -use Michelf\MarkdownExtra; - /** * Wiki markup parser * @@ -27,7 +25,8 @@ public function __construct(net_nemein_wiki_wikipage $page) public function get_html() : string { - return MarkdownExtra::defaultTransform($this->get_markdown($this->_page->content)); + $parsedown = new Parsedown(); + return $parsedown->text($this->get_markdown($this->_page->content)); } public function get_markdown(string $input) : string diff --git a/src/midcom/datamanager/template/view.php b/src/midcom/datamanager/template/view.php index 1f4cefb5cc..465655d4e0 100644 --- a/src/midcom/datamanager/template/view.php +++ b/src/midcom/datamanager/template/view.php @@ -4,9 +4,9 @@ use Symfony\Component\Form\FormView; use midcom; use midcom_helper_formatter; -use Michelf\MarkdownExtra; use Symfony\Component\Form\ChoiceList\View\ChoiceGroupView; use midcom\datamanager\renderer; +use Parsedown; class view extends base { @@ -197,7 +197,8 @@ public function text_widget(FormView $view, array $data) return midcom_helper_formatter::format($data['value'], 'f'); case 'markdown': - return MarkdownExtra::defaultTransform($data['value']); + $parsedown = new Parsedown(); + return $parsedown->text($data['value']); case (str_starts_with($view->vars['output_mode'], 'x')): // Run the contents through a custom formatter registered via mgd_register_filter