Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace pagedown with editor.md for enhanced Markdown editing #663

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

anasfanani
Copy link

This pull request replaces the current Markdown editor, pagedown, with editor.md, which offers more features.

I've chosen to use a fork of the original editor.md repository (https://github.com/pandao/editor.md) that has the most stars. The forked repository used is https://github.com/hawtim/editor.md.

You can see a live example of editor.md here: https://pandao.github.io/editor.md/en.html

Here's a screenshot of HTMLy using editor.md:
image

I'm new to GitHub and Git, so I would appreciate any guidance on how to contribute to the HTMLy project. Thank you!

@danpros
Copy link
Owner

danpros commented Dec 20, 2023

Thanks for the PR!

@bttrx
Copy link
Contributor

bttrx commented Dec 23, 2023

Why switch to a component no longer maintained?

@anasfanani
Copy link
Author

I've been exploring various Markdown editors to implement. I started my search on this, to looking at repositories related to Markdown editors.

I first came across the 'stackedit' repository, which has over 21k stars and 600 issues. However, its last release was in 2019 and I'm not familiar with it, so I decided to skip it.

Next, I found 'simplemde-markdown-editor' with 9.6k stars and 263 issues. Its last release was in 2016 and it only had a few examples, so I skipped this one too.

Then, I discovered 'editor.md' which has 13.3k stars and 500 issues. Despite its last release being in 2015, it had more examples which made it easier to implement. However, I realized this project is obsolete, so I searched for a more recent forked version.

I compared the versions of 'editor.md' from the 'pandao' and 'hawtim' repositories, and decided to use the 'hawtim/editor.md' due to its more recent update in 2018.

Lastly, The 'pagedown', last published version was 11 years ago in 2013.

In conclusion, I've decided to update the Markdown editor in HTMLy with 'hawtim/editor.md', as I couldn't find a better alternative.

@anasfanani
Copy link
Author

@bttrx

I checked out the demo for https://github.com/markedjs/marked at https://marked.js.org/demo/. It seems like there's no toolbar, which could be helpful for people who are not familiar with Markdown syntax.

For the site https://github.com/terrylinooo/githuber-md, it's using the official editor.md 1.5.0.14. You can find the implementation details here: https://github.com/terrylinooo/githuber-md/blob/5ae517a549600f719645d35baf30b29a8069ebcc/src/Controllers/Markdown.php#L30C7-L30C7.

As for https://github.com/portive/wysimark, unfortunately, image uploads are only possible through the API. More details can be found in the documentation: https://www.wysimark.com/docs/js. Currently, I'm not familiar with Vue, React, or Node.js, but I might be able to help in the future once I've gained proficiency in these technologies.

For this :

I'd like to try it. However, I'm not sure how to implement it in HTML at the moment.

@ZachBacon
Copy link

How complete is this nearing? I'm very much interested in this if it can extend the markdown capabilities.

@bttrx
Copy link
Contributor

bttrx commented Jan 6, 2024

@anasfanani

Why do you think using editor md is not a good option ?

  1. As I already said: I have major (not only security) concerns to embed a component last updated 5 years ago.
  2. editor.md depends on numerous other components:
  3. Minor: Lots of communication is in Chinese, so I need Google Translate to understand.

Would switching to editor.md solve the HTMLy problem, that edit preview for a post differs from a post's final display?

@bttrx
Copy link
Contributor

bttrx commented Jan 6, 2024

@anasfanani

I compared the versions of 'editor.md' from the 'pandao' and 'hawtim' repositories, and decided to use the 'hawtim/editor.md' due to its more recent update in 2018.

Last commit to pandao was on May 9, 2019, while last commit to hawtim was on Aug 29, 2018.
So, in fact, pandao is more recent than hawtim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants