SimpleMDE (Markdown Editor) , Marked.js for page visits.

Post Reply
mjxl
Posts: 9
Joined: Thu Jan 30, 2020 4:57 am

SimpleMDE (Markdown Editor) , Marked.js for page visits.

Post by mjxl »

Just pushed my first plugin to github ! \o/

This implements SimpleMDE and /Snarkdown not anymore/ Marked.JS
SimpleMDE is the editor for owners, the Markdown content will be rendered via Marked.JS.

It probably needs some fixing, cleaning and I saw the output for visitors could use some formatting.. :lol: :?

Enjoy !

https://github.com/mjuksel/wondercms-markdown
Last edited by mjxl on Sat Feb 08, 2020 7:01 pm, edited 1 time in total.

mjxl
Posts: 9
Joined: Thu Jan 30, 2020 4:57 am

Re: SimpleMDE/snarkdown (Markdown Editor)

Post by mjxl »

I pushed a couple of changes here and there :) A bit messy on github :lol:
  • Removed Snarkdown.js in favor of Marked.js
  • Swapped the local JS/CSS files to CDN delivered ones (jsDeliver).
  • Added a custom.css so we can override styles.
  • Some small tweaks here and there.

wiz
Admin
Posts: 423
Joined: Sat Oct 30, 2010 12:23 am

Re: SimpleMDE (Markdown Editor) , Marked.js for page visits.

Post by wiz »

I love the idea and great work!

When reviewing the plugin and testing it, I ran into two issue:
1. The "wondercms-markdown.php" file tries to include JS files from "wonder-markdown" insteaf of "wondercms-markdown".
2. After fixing the above issue, the editor didn't load.
- Please update your WonderCMS to the latest version (3.0.5) and re-run this plugin.

After successfully testing and adding this plugin tot he official repository, we'll add you to our list of contributors: https://wondercms.com/special-contriboturs

Thanks for becoming a part of the WonderCMS journey! :)

mjxl
Posts: 9
Joined: Thu Jan 30, 2020 4:57 am

Re: SimpleMDE (Markdown Editor) , Marked.js for page visits.

Post by mjxl »

Crep, I saw it.

I had fixed it on my server , but not yet locally.
Updated to 3.0.2 !

Also could you tell me how to get all the areas for the user?
Right now i'm doing just $('#content'), this could be changed by either the users, or up front by me.

//edit: (I don't really get the PHP parts.. even JS is fairly new to me.)
Last edited by mjxl on Wed Feb 12, 2020 3:43 am, edited 1 time in total.

mjxl
Posts: 9
Joined: Thu Jan 30, 2020 4:57 am

Re: SimpleMDE (Markdown Editor) , Marked.js for page visits.

Post by mjxl »

And i fixed it again. :) 3.0.3 works.

wiz
Admin
Posts: 423
Joined: Sat Oct 30, 2010 12:23 am

Re: SimpleMDE (Markdown Editor) , Marked.js for page visits.

Post by wiz »

Will re-check/test and add the plugin.

Hopefully this can happen with the 3.0.6 patch, as we found a minor bug where line breaks (br tags) get removed on second edit.

Cheers and thanks!

mjxl
Posts: 9
Joined: Thu Jan 30, 2020 4:57 am

Re: SimpleMDE (Markdown Editor) , Marked.js for page visits.

Post by mjxl »

wiz wrote:
Sun Feb 16, 2020 11:13 am
Will re-check/test and add the plugin.

Hopefully this can happen with the 3.0.6 patch, as we found a minor bug where line breaks (br tags) get removed on second edit.

Cheers and thanks!
Cool, I've also added some new 'features' on my local version.

Added 2 buttons to the editor
One button is to save directly as HTML, this way we don't need a processor for visitors, and do other cool stuff.
The other one cleans the content of HTML, this is when you want to revert back to plain text.

Then I've got a second editor nearly doing what i want, which is far superior to this/summernote :geek:

Post Reply