Comments (3)
This is by design: passing undefined
makes BlockNote initialize the editor with an empty paragraph block. I think this is a common pattern (use a default value, when passed undefined
). I think using a default value (empty paragraph block) when passing []
would not be very clear for consumers; hence the error.
(I think both approaches can be valid ofc)
from blocknote.
Hi. If I may, I have some follow up questions, Not a big expert on neither prosemirror nor tiptap, but as I understand, the docuement
model seems like a tiptap's json wihout a root doc
, is this correct? - It may confuse some people moving from tiptap since the document model does not match (I personally expected the way working with blocknotes' document model would be identical to tiptap.
Not a big problem though!
from blocknote.
Hi. If I may, I have some follow up questions, Not a big expert on neither prosemirror nor tiptap, but as I understand, the
docuement
model seems like a tiptap's json wihout a rootdoc
, is this correct? - It may confuse some people moving from tiptap since the document model does not match (I personally expected the way working with blocknotes' document model would be identical to tiptap.Not a big problem though!
Actually, BlockNote's editor.document
is a bit different from TipTap's JSON representation, though admittedly it's mostly a difference in naming. The reason it's different is so that we can have strong typing - TipTap doesn't care what you pass to commands like setContent
whereas BlockNote is strict on what you can pass to e.g. replaceBlocks
.
This is because you can have huge flexibility with the schema in TipTap, but BlockNote is more rigid, and the general structure of blocks can't be changed. But you're right, the way that the document is represented in TipTap using JSON vs how it's represented in BlockNote with Block
objects is pretty close.
from blocknote.
Related Issues (20)
- About custom formatting toolbars HOT 1
- The ability for the blockgroup element to collapse/expand.
- SideMenu Shadcn major bug HOT 2
- Missing File Upload Block Dark Theme
- Add built-in support for converting "->" to "→" HOT 1
- json to html on server HOT 1
- Need Help: Converting JSON to HTML in Blocknote HOT 2
- Custom Formatting Toolbar input loss focus HOT 3
- document is not defined HOT 1
- Getting errors while using blocknote/react HOT 1
- Class 'BlockNoteTipTapEditor' incorrectly extends base class 'Editor'
- When pasting link as first item everything after it gets added
- Formatting Toolbar is displayed after block is dragged
- Emoji picker throwing type error in next.js HOT 2
- @emoji-mart/data increases bundle size significantly (400KB)
- Block drag to top of document doesn't work HOT 3
- Format toolbar goes offscreen on mobile
- Add Word/Character Counter and Limitation
- Clean up inline components in examples
- Investigate server-util package usage for Next.js SSR and other environments HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blocknote.