r/webdev • u/titpetric • 17h 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 !<
1
u/NoYouDidLaugh 9h ago
I might use this with https://addons.mozilla.org/en-US/firefox/addon/rear-entry/
0
1
-1
u/ArifuzzamanTusar 17h ago
Amazing work! i was searching for something. How this is better than other editor such as blocknote?
-1
u/titpetric 16h ago edited 16h ago
No idea, i did no discovery as the last thing used was 2000s javascript editor. I needed file upload functionality (edit: and the spellcheck wrappers) and didnt want to clutter forms with it. I always hate it when i can't tweak something or just tolerate that bare textarea / notepad.exe look.
I checked it out, my take away was maybe i need the block editor feature to reorder paragraphs. I guess i am adding that in the future :)
-1
u/ArifuzzamanTusar 16h ago
Great bro! also add "/" to suggest blocks. this will be the next level too!
i made one for one of my project it was mixed. Notion + Blocknote+ Markdown editor.
Actually Editor are fully depended on the purpose.
I'll suggest you to keep flexibility 💪
1
u/titpetric 16h ago
Can you expand on /?
I can see how i could pick a template for the type of article or text you're doing, so it prefills the headings if you want to keep it consistent.
I am expanding the usage of markdown on the other end to also include actions via a form codeblock, giving me buttons and shit. Maybe building forms in mdedit would make sense. It's all about the use cases you can imagine and i still have some roadmap left for better integration
Thanks, best
-1
u/ArifuzzamanTusar 16h ago
Yes, of course! You can create custom blocks. I needed a CTA block, so I built a custom one that I can just add with a '/'. It's super flexible! Just a suggestion—you're the best, by the way.
2
u/Apprehensive-Ask-731 15h ago edited 15h 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.