Plugins » EasyMark: MarkDown for Typesetter (GPEasy) 1.3.1

only works in PHP 5.4+
Topic Closed
juergen
1.5K Posts
54.5K Downloads
16 Plugins
design, web development & visual effects

Hi Peter,

EasyMark will throw an unrecoverable fatal error when run under PHP 5.3 (which is Typesetter's minimum requirement).

Fix: using PHP 5.3 notation:

EasyMark.php

instead of

-line 27:           $section_data['content'] = (new Renderer($config, $addonPathCode."/lib/parsedown/"))->render($section_data['content']);

use

+line 27:           $renderer = new Renderer($config, $addonPathCode."/lib/parsedown/");
+line 28:           $section_data['content'] = $renderer->render($section_data['content']);

 

EasyMarkAdmin.php

instead of

-line 108:           print (new Renderer($this->settings, $addonPathCode."/lib/parsedown"))->render($_REQUEST['content']);

use

+line 108:           $renderer = new Renderer($this->settings, $addonPathCode."/lib/parsedown");
+line 109:           print $renderer->render($_REQUEST['content']);

 

WYSIWYG.php

-line 18:             print (new Renderer($config, $addonPathCode."/lib/parsedown"))->render($_REQUEST['content']);

+line 18:            $renderer = new Renderer($config, $addonPathCode."/lib/parsedown");
+line 19:            print $renderer->render($_REQUEST['content']);

 

And line 48 should be

$this->settings = $this->defaults;

instead of

$this->settings = $defaults;

 

Edited: 4 years ago#8922

juergen
1.5K Posts
54.5K Downloads
16 Plugins
design, web development & visual effects

Aside of the above mentioned code I have also made some changes to edit.js.
I don't know, if every change I made was really necessary, but when adapting my own plugins it seemed to be a good practice to move as much JS stuff as possible out of global scope.

So, here is an updated version 1.3.1 that works for me with TS 5.

Please try yourself if it still works at your side ;-) I'm myself still a bit uncertain how to code right for the new Typesetter UI.

Edited: 4 years ago#8923

ppeterka
4 Posts
1.2K Downloads
1 Plugins

Thanks Jürgen!

I applied your changes, and added an Acknowledgements section to the Admin page too. Currently I only had an older 4.5 instance to test on, but worked flawlessly.

Feels great to see my plugin is really being used :)

4 years ago#8928

Topic Closed

 

News

elFinder 2.1.50 in Upcoming Release
12/28/2019

A new release for Typesetter is in the works with a lot of improvements including the ... Read More

Typesetter 5.1
8/12/2017

Typesetter 5.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

More News

HH-Support

Company located in Tórshavn, Faroe Islands. * Webpage Design * Consultant & Provider of a wide range of programs for visually impaired and dyslextics.

Find out more about our Provider Spotlight

Log In

  Register