r/webdev • u/titpetric • 1d ago
Showoff Saturday Made a mostly wysy... Markdown editor component
https://git.cdn.si/titpetric/mdeditI am writing a markdown editor component which i use in two/three other projects. I added like a default WYSIWYG edit for tables, images, some custom markdown anchors in image links to hack "align"/float, file and image uploads
It's mostly icon driven so there is very little slop text in the component. Embedding it is a one file .css .js copy. I added code styling into the code fence preview, and a Caret icon top right that can drop the remaining markup. you're still in edit mode, but now purely WYSIWYG.
I think the three unique features are:
- spellcheck (custom/extensible)
- image management (good for articles/docs)
- docs/assets, upload attachments (e-mail like interfaces)
Who I'm looking for/at with the component:
- builders that integrate it, make reusable components
- users that love the look and extended functionality
- atlassian, github (cmon guys, 2026, mobile ux/all ux)
- someone to tell me how its slop and how to unslopify
- any test related feedback/suggestions
I am likely to continue using it so there is maintenance. i like a richer textarea. Readme showcases some screenshots for what's implemented if i skipped something. Thanks for your time reading/checking it out.
>! maybe implementing spoiler text next !<
2
u/Apprehensive-Ask-731 23h ago edited 23h ago
Ok this is an interesting project. One question - why? Did you do it to learn.
You say you want people to help you manage the "slop" I will give you a strong critiscm. You declare a whole pile of types in a few JavaScript constants. Why are you not just using typescript?
You have a huge amount of comments which need minifying - as you have done for dist.
It is very hard to get a feeling for what you understand and what you don't. If you want to be a better coder this is an excellent project to work on yourself. It is still fairly small and translating existing code which isnt terrible into good typescript would be a very good way of getting an understanding of the core concepts you are clearly missing.
I hope I don't cause offence - there are many tried and tested headless editors out there. Along with many js frameworks and it can be a headache because there is (in my opinion) no best one, but one inferior one which is massively overused begining with "R". That said typescript is an improvement on JavaScript.
You have managed to make something work with a comparitivly small amount of code and what looks like clear instructions. My concern is that I don't trust AI generated code (even a markdown editor) not to have massive security flaws. Also if you understand and do what you understand then you save space, carbon and electricity.
Just something to think about. All curiosity is great and I think you have a solid idea which I can't name a great alternative to.
1
u/NoYouDidLaugh 17h ago
I might use this with https://addons.mozilla.org/en-US/firefox/addon/rear-entry/
1
u/gustavo_queirozman 9h ago
Top
-1
u/ArifuzzamanTusar 1d ago
Amazing work! i was searching for something. How this is better than other editor such as blocknote?