See web/components/editor/knowledge.md for documentation

TipTap is a “headless” editor - meaning it handles the core functionality but not the styling.

styling is currently handled by the tailwind typography package. this is easy to change

Sinclair thinks TipTap is still a fine choice for the editor component itself. storing json was a mistake. oh well.

upgrading to TipTap 2.5+ would enable ssr via the immediatelyRender prop on the tiptap editor. this which would let you get rid of my custom generateReact function in editor/utils.

upgrading to TipTap 3.0+ (which is not yet out) would let you get rid of tippy.js and popper as dependencies in the web bundle

also TipTap advertises kind of AI integration now, so you may want to upgrade just for that, but I suspect it’s better to roll the extension ourselves

Possible Migrations & Features

migrate from tiptap json → markdown (not recommended)

  1. use generateHTML from the latest @tiptap/html to convert TipTap json to html
  2. parse HTML into markdown with marked

recreate market previews as react

  1. create a new extension for market previews.
  2. modify editor/market-modal.tsx to insert the new market preview
  3. (optional) when people create/edit an iframe url to manifold, replace the iframe itself with the new market preview.
  4. create a function: given tiptap json, traverse the content and convert all iframes with manifold.markets/(embed/) into new extension’s json
  5. run as a migration function in batches.
    1. alternatively in contract static props: use the function to get the new content. you could even, if the output is different, do an api call to update it in the db.

move link previews outside of the content