50 ms·
Wordgard: In-browser rich-text editor from the creator of ProseMirror
- haroldadmin 3mo agoProseMirror is an excellent project, but it’s always been a bit awkward using it directly in React. I remember that NYT had to rewrite the renderer to make it work for their use-case. I wonder how Wordgard compares in this aspect!
- alserio 3mo agoThat's due to the React constraints, though
- yard2010 3mo agoCan you please elaborate? What constraints exactly?
- alserio 3mo agoReact expects to own the DOM and that state is managed by pure functions. There are good reasons for this, but the consequences are that it's restricting how the web platform works and when something does not agree with it weird things can happen. Is it bad? Sometimes. Is it the rest of the Web fault? I don't believe so. If you are using React you are largely constraining yourself to work in the React model, not in the Web model. That might be fine, but it might also not be.
- exceptione 3mo agoFor people who have dealt with react, this part might give some insight into that topic (https://wordgard.net/docs/prosemirror/#h-transactions-and-changes https://wordgard.net/docs/prosemirror/#h-transactions-and-ch...)? Nevertheless, it would be good if this could be addressed in the docs. I am not sure if this makes things easier for react interop, but this piece might be of interest too: > One of the biggest mistake blunders in ProseMirror is that the editor view does not get access to the transaction objects when updating, just the state. Wordgard does not repeat this mistake, and makes updates take transactions, not just a new state. > This means that things like the DOM update logic and UI plugins can precisely observe what happened, and handle changes in a efficient and more effective way. The weird unexpected DOM redraws that are still a thing in ProseMirror should not occur. Only the precise DOM structure affected by the new transactions will be updated. Anyways, it is great to see Merijn still going strong with his free work. Anyone needing interactive rich text on the web won't find anything better than his brain childs.
- tefkah 3mo agoThe people developing that left NYT and spun it out into a separate (really great!) project https://github.com/handlewithcarecollective/react-prosemirror https://github.com/handlewithcarecollective/react-prosemirro... They are also working on a collaborative editing suite for ProseMirror as an alternative to TipTap https://pitter-patter.dev/ https://pitter-patter.dev/
- milkshakeyeah 3mo agoI can’t believe that we are still trying to solve this. One would think that after so many years (I’ve started doing web almost 20 years ago) we would end up with some solutions baked in browsers
- yoz-y 3mo agoSomething like showcontrols for contenteditable with flags for features
- nicce 3mo agoI think the issue is not the "solving", rather that people have different opinions and they want different things, and there isn't common agreement what is needed or how. Most editors work just fine for the basic needs. But well, that is my opinion.
- exceptione 3mo agoI think most people would love to the know the 'why'. This page discusses differences with prosemirror and is the closest I got to that question: (https://wordgard.net/docs/prosemirror/ https://wordgard.net/docs/prosemirror/). One thing to note is that there is not an upgrade path. Many concepts are shared with prosemirror, but it seems that switching means doing quite some work (correct me if I am wrong). Obsidian is based on Code Mirror so I guess they won't be switching, but tiptap.dev and others do. @marijn, maybe you could address why wordgard is worth the switching cost? EDIT: I see many points are addressed in Marijn's personal blog. I submitted (https://marijnhaverbeke.nl/blog/wordgard-0.1.html https://marijnhaverbeke.nl/blog/wordgard-0.1.html) to HN for better context.
- maxloh 3mo ago"Why is it worth the switching cost?" is the genuine question I have too. Or more importantly, why not just make it ProseMirror v2? The landing page needs more information about the "why" rather than the "what".
- Garlef 3mo agoFrom the blog post: > A ProseMirror 2.0 with an incompatible interface would amount to the same but make it ambiguous what people mean when referring to ProseMirror. Trying to graft stuff on in a backwards-compatible way as an 1.x version would produce a compromised win32-style mess.
- Garlef 3mo agoFrom the blog: > I'm not all that fond of the ProseMirror pun anymore either (it's CodeMirror but for prose, get it?) So... It's time for someone to create Codegard, i guess?
- marijn 3mo ago> why wordgard is worth the switching cost? It may not be. If you're happy with ProseMirror, continue to use ProseMirror. I have your back. But as the blog posts describes, I had a whole pile of new design insights that avoid some of the issues I've ran into with ProseMirror, so I had the itch to build a new iteration. I'll add a link to the blog post to the docs section of the website. (It's marijn, not merijn.)
- chrisjj 3mo agoAt Try, I entered x and tapped what I presume is Undo. No effect. Android Chrome.
- marijn 3mo agoTried to reproduce this, also on Chrome Android, but undo removes the typed character as expected.
- aniviacat 3mo agoI ran into some issues on Firefox Android. I wanted to clear the text box, so I marked the entire text and hit backspace. It only removes the last letter. So then I marked the entire text and pressed a letter. That successfully replaced all the text with the one letter. But then the editor broke completely. I cannot put newlines anymore, backspace is inconsistent, and the text cursor isn't shown. (The editor breaking after marking all the text and pressing a letter is reproducible.) At least on mobile the editor seems to still be unstable.
- marijn 3mo ago(Filed this [here](https://code.haverbeke.berlin/wordgard/wordgard/issues/3 https://code.haverbeke.berlin/wordgard/wordgard/issues/3).)
- yodon 3mo agoThe code appears to be unavailable. This includes not just wordgard but all the ProseMirror code as well. If the motivation for moving off GitHub was "GH is down too much", it might be worth tracking how many 9's of uptime is lost in the self-hosted case.
- nmstoker 3mo agoWere you meaning it was unavailable temporarily? Maybe something changed in the meantime, but I'm seeing what appears to be the code for it here: https://code.haverbeke.berlin/wordgard/wordgard/src/branch/main/src https://code.haverbeke.berlin/wordgard/wordgard/src/branch/m...
- jitl 3mo agoWorks for me: $ git clone https://code.haverbeke.berlin/wordgard/wordgard.git Cloning into 'wordgard'... remote: Enumerating objects: 8274, done. remote: Counting objects: 100% (8274/8274), done. remote: Compressing objects: 100% (4747/4747), done. remote: Total 8274 (delta 6049), reused 5002 (delta 3464), pack-reused 0 (from 0) Receiving objects: 100% (8274/8274), 1.61 MiB | 2.93 MiB/s, done. Resolving deltas: 100% (6049/6049), done.
- marijn 3mo agoI've had another report like this (they claimed it had been down for days). But I haven't noticed anything wrong with it (and I'm using it a lot). What did 'down' look like? Also, though GitHub's lack of reliability was part of the motivation to self-host, it was only a minor factor. The way they are trying to make Copilot a thing, at the cost of everything else, the way they handle US sanctions by blocking everybody from entire countries, and the way the web interface feels ever more heavyweight and sloppy were also factors.
- yodon 3mo agoI was on my phone, so all I saw was a generic Safari error message. I think it was site not found, but I don't recall. I'm able to see it now, but am coming in through a different network provider in case that matters. Also, not to be an apologist, but I trust you realize that "the way they handle US sanctions by blocking everybody from entire countries" is how US companies are required by law to act. Not all do act that way, of course, but almost any that have enough overseas customers to matter do, because they have enough overseas customers to need to be aware of those laws.
- chrisjj 3mo agoHow do I get text labels on the buttons?
- marijn 3mo agoThe menu can be replaced, either entirely or by item, but the default buttons use icons, not text labels.
- mapt 3mo agoGetting that WYSIWYG editor up and running was a major stumbling block that I overcame to get my school newspaper a PHP-Nuke site ~25 years ago. It is insane that there isn't a web standard implementation for this passed 15 years ago.
- CGamesPlay 3mo agoThere is contenteditable, which is what all these (Wordgard, ProseMirror) are fundamentally built on. The rest is just the UI, and interop with systems that don't desire arbitrary HTML as input.
- atombender 3mo agoWhile these use contenteditable, it's not accurate to say they're just contenteditable plus some UI and interop. None of these modern editors (Wordgard, ProseMirror, Lexical, Slate) use contenteditable for the document model. Rather, they have their own internal document model and use contenteditable as a kind of input layer where the editor monitors what the browser does, then translates that into actual edits. Early editors like FCKEditor and TinyMCE were only wrappers around contenteditable. They used the DOM as the real document model, then intercepted certain keypresses and events and "fixed" the behavior when it wasn't correct (e.g. double enter inside a bullet list should switch to paragraph mode). The result was rife with bugs and inconsistencies, and didn't allow for a proper split between the model and the view (e.g. to represent columns, video embeds, and so on).
- rubyfan 3mo agoI’m not a historian but I think FCKEditor and TinyMCE predated contenteditable. These were solutions wrapping textarea back in the day if my memory serves me.
- atombender 3mo agoMy memory is fuzzy here, so I may be wrong. But I remember the generation of buggy WYSIWYG editors that preceded ProseMirror, and they were all contenteditable-based. They would typically start by attaching to a textarea, but then replace it with a div.
- mhitza 3mo ago~6 years ago had a very hard time researching and implementing an @-style remote resource completion (other users and documents to reference) and the style of extensions in this editor seem very much like an evolution of prosemirror. I'd really appreciate it this was something built in, not something I have to build based on the dinosaurs example. Every time I need to reach for one of these text editor libraries that is my no. 1 usecase, followed by WYSIWYG.
- CrzyLngPwd 3mo ago@ mention style built in would be fabulous, just provide an API. As would first class mobile support.
- marijn 3mo agoFirst-class mobile support should be there (though there will be bugs, given that this hasn't seen much real-world testing yet — report them if you see them). I haven't entirely decided what utilities I'm going to include in the core library, but mentions are definitely on the list for potential inclusion.
- nicce 3mo agoI would be curios that what are the cons/pros for selecting this over Facebook's Lexical (https://github.com/facebook/lexical https://github.com/facebook/lexical)
- keepupnow 3mo agoMy exact comment, Lexical is very powerful and needs little dependencies.
- low_tech_punk 3mo agoI believe Wardgard has zero external dependencies. The three packages it depends on are all utils written by the author himself. https://code.haverbeke.berlin/wordgard/wordgard/src/branch/main/package.json https://code.haverbeke.berlin/wordgard/wordgard/src/branch/m...
- yule 3mo agoThe artwork on the website is beautiful! What a (forgotten) way to draw ones attention.
- keepupnow 3mo agoWith AI slop everywhere it is extremely refreshing to see hand-drawn beautiful illustration.
- TiredOfLife 2mo agoFirst thing i thought when looking at the site was: "too many AI illustrations"
- keepupnow 2mo agoYou didn't check the credits then...
- yard2010 3mo ago"contains 0% AI" too! This artist is awesome
- lewisjoe 3mo agoThis is amusing as well as slightly scary. Prosemirror over the years has become the backbone of editors on the web. ChatGPT uses it. Gemini uses it. Linked chat and feed composers are Prosemirror powered. Literally every serious product uses Prosemirror for composing text on the web. There is an entire YC company built on top of Prosemirror (Tiptap). The thought that Prosemirror is no more in active development is scary.
- john_strinlai 3mo ago>The thought that Prosemirror is no more in active development is scary. From their blog: "I'm still proud of ProseMirror, and ProseMirror isn't going anywhere—it will continue to be maintained."
- curtisblaine 3mo agoThe only scary thought is that all these important operations don't have a plan B if prosemirror, a software they don't write, don't own and presumably don't pay, goes away.
- marijn 3mo agoMany of them do pay. Also MIT-licensed software doesn't 'go away' all that easily. If a piano fell on my head tomorrow, interested parties would probably manage to continue development in a fork.
- r0b05 2mo agoYou are correct, but please watch out for falling pianos because we appreciate your work.
- Imustaskforhelp 3mo agoObligatory xkcd: https://xkcd.com/2347/ https://xkcd.com/2347/ but as @john_strinlai as I have said it doesn't seem like Prosemirror is going unmaintained. It will continue to be maintained but I think its worth thinking about the structure of the whole thing being so similar to the xkcd which is what might be the scary part of it.
- goodwillhunting 3mo agoThe editor aside, really impressed by the artist who did he design - really tasteful, def stood out for me https://kamilastankiewicz.com/ https://kamilastankiewicz.com/
- techpression 3mo agoThe graphics are amazing, feels Ghibli-esque, which is crazy to say in the context of a rich text editor.
- bluerooibos 3mo agoSame thought here - beautiful! I'm curious what the price tag is for getting some illustrations like this done for an existing website.
- jiffygist 3mo agoI don't like WYSIWYG on the web. You do a long and tedious formatting of a forum post, then close the tab and it's all gone. I prefer to use a local text editor then Ctrl+V into web form. Which I can with markdown
- justusthane 3mo agoI've seen this solved in some platforms with localstorage, so that it automatically saves your "draft" as you type and seamlessly restores it if you re-open the page. It was a really nice surprise the first time I experienced it (after closing a tab by mistake).
- 8-prime 3mo agoIt depends for me. For my blog I have a web based editor, but one, that is just plain markdown with a preview. Similar to your described workflow. For a note taking app I decided to use WYSIWYG because I don't have the space for a split view and didn't want to just look at the markdown as is. My main gripe with WYSIWYG is that they can get in your way. When I create a verbatim block and can't leave that block anymore (looking at you Teams). I guess thats also why I enjoyed LaTeX as much as I did.
- keepupnow 3mo agoAny sites that have forms or editors that don't save your progress with localstorage need to leave the web and not come back.
- yard2010 3mo agoCheck out Linear, I'm not affiliated, just yesterday I happened to close the dialog by misclicking and when I pressed create issue again there was the wall of text I wrote. My point is it's not a technical problem but a product one.
- ValentineC 3mo agoThere was a discussion about Linear 26 days ago, which is a pretty cool read: https://news.ycombinator.com/item?id=48437609 https://news.ycombinator.com/item?id=48437609
- andredurao 3mo agoThe design and aesthetics of the page are really impressive, but what caught my attention was the "Deluxe API" which was new to me because I hadn't heard of it before.
- keepupnow 3mo agoWhy this over Lexical by Meta?
- lewisjoe 3mo agoThe person who got inspired by prosemirror and built lexical is no more at meta. Go to the repository and you'll find it's already in maintenance mode. Its promise of cross platform extensible editor is unrealised yet. I'd pick prosemirror any day over Lexical.
- nicce 3mo agoSeems like the contribution graph is on the highest for long time: https://github.com/facebook/lexical/graphs/contributors?from=6%2F29%2F2024 https://github.com/facebook/lexical/graphs/contributors?from... But Claude is playing part of it.
- keepupnow 3mo agoYou are wrong, Lexical it is not in maintenance mode and continues to receive commits from contributors. 24k stars and counting. https://github.com/facebook/lexical https://github.com/facebook/lexical
- baptistejamin 2mo agoWe used Lexical intensively in my company (Crisp), and I can confirm it's definitely not in maintenance mode. What's super cool with Lexical is the package/extension system. For instance, we use the Lexical markdown package a lot; it's not the gold standard yet, but since we have a large user base, over the years we've made a few PRs to the Lexical team, and they approved/reviewed the PRs in 24 hours. About WordGuard: There is no community behind it; the guy building it clearly wants no AI involved and even has his own internal Git hosting system. Finally, there is no single user on WordGuard. I see virtually no reason to use Wordgard over lexical.
- jamwil 3mo agoBecause Meta is a harmful company, for one.
- low_tech_punk 3mo agoIf you click on the "create link" button multiple times, the menu would pile up vertically.
- marijn 3mo agoSee https://code.haverbeke.berlin/wordgard/wordgard/commit/9c9b2cfa3666b1bd33021716080cfaf2f8ae9461 https://code.haverbeke.berlin/wordgard/wordgard/commit/9c9b2...
- wood_spirit 3mo agoThis looks staggeringly brilliant. I was searching for something like this recently but ended up rolling my own using a block-based OT to local server and diff sync to remote ones. I’m reading the system guide and nodding along. It’s super validating to see the similarities and contrasts.
- davidpapermill 3mo agoProseMirror (and presumably Wordgard) just gets so much right.
- whalesalad 3mo agoI love this art style. It's like if textpattern wasn't depressed.
- politician 3mo ago[dead]
- andrewingram 3mo agoOne thing i've struggled with with Prosemirror (via TipTap) is that I very often need to interact with JSON representation of the document programmatically to extract data from it, this means I need (okay, strongly prefer) a statically-typed representation of it. Prosemirror doesn't really have any mechanism to do this, so i've ended up doing one of these two things: 1. Define the schema twice, once using Prosemirror and once using something like Zod. Then having a battery of equivalence tests to assert that the schemas match. 2. Build a meta schema definition layer that can output a Prosemirror schema, but conforms to the standard schema spec (https://standardschema.dev/ https://standardschema.dev/), this approach is more viable if not using something like Tiptap. I haven't tried using Wordgard yet, so I can't tell if it does anything to address this, but just calling it out as a pain point i'd love to see solved.
- ang_cire 3mo ago:q!
- azeirah 3mo agoI am so, so happy to see real art for once? It looks great.
- c-hendricks 3mo agoI absolutely hate WYSIWYG editors, they're more "what you get is what I deem possible, through much frustration on your end in trying to tidy things up". Slack on mobile is particularly bad. Didn't get very far with this one either. Tapped a correction on iOS keyboard and the replacement showed up for a split second before the whole word disappeared.
- jzer0cool 3mo agoInterested to here what you all might like using this for.
- dstaley 3mo agoOne area every editor has failed for me is a very basic one: can I type a full sentence in the editor using my iPhone? Wordgard failed that test. Inputs coming from autocorrect or the keyboard suggestions are swallowed and delete the partially typed/misspelled word.
- josephg 3mo agoYeah I did a review of web based rich text editors a couple years ago. They all seemed fine on desktop, but on mobile every one I tried was junk. I couldn’t select. Autocorrect was broken. Tapping text didn’t move the cursor. Typing would stop working. The keyboard wouldn’t disappear when the element lost focus. And so on. There have been several efforts over the last couple decades to add a proper rich text element to the web. I don’t know why they have all failed - I guess it’s a large, complex and thankless task. It’s a pity. Proper native rich text support is one of the web’s big blind spots. It’s a problem native platforms have solved decades ago.
- syedfakhtar 3mo agoMeta has a text editor framework called Lexical that works well on mobile, I've used it at work before with great success. Perhaps you missed this one? https://lexical.dev/ https://lexical.dev/
- alfirous 2mo agoThis one if I recall also used by Payload CMS.
- oneshtein 3mo agoFix your phone.
- lioeters 2mo agoThat's the ideal solution, because (it seems to me that) the issues that break rich text editors are caused by non-interoperable ad-hoc hacks from mobile browsers and operating systems. These rich text editors can work perfectly fine on desktop browsers, yet have countless buggy behavior on mobile. The editor side is not the main problem, it's the mobile side that needs to be fixed and better implemented in a consistent manner across platforms.
- lucas_t_a 3mo agoi loaded it, tried deleting by swipping backspace, it did not work...
- iwantitez 2mo ago[dead]