mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-02-01 21:52:44 +01:00
9fca2d3b9b
* start removing raw serializer * convert first tests to use jsx * simplify jsx tests for raw serializer * allow for options in raw serializer tests * add more preserve option tests * convert plain serializer tests * convert html serialize * start converting html deserialize * add hyperscript util * remove slate-sugar copy-pasted * finish converting html deserialize * convert plugins tests * update rendering tests * convert schemas tests * convert core plugin tests * update hyperscript utl * refactor changes test directory structure * fix changes before migration * add migrated changes test files * remove <x- prefixes from migration * get addMark at-current-range tests passing * get delete at-current-range tests passing * remove old tests * convert deleteForward and deleteBackward * convert insertBlock, insertInline, insertFragment, insertText * convert removeMark, setBlock, setInline, splitBlock, splitInline * add unstaged tests * convert toggleMark, unwrapBlock, unwrapInline, wrapBlock, wrapInline, wrapText * convert call, setData * convert on-selection tests * remove old on-selection tests * convert history tests * convert insertFragmentByKey, insertNodeByKey, insertTextByKey, mergeNodeByKey, moveNodeByKey * convert removeNodeByKey, removeTextByKey, setMarkByKey, setNodeByKey * convert splitDescendantsByKey, splitNodeByKey, unwrapBlockByKey, unwrapInlineByKey, unwrapNodeByKey, wrapBlockByKey * fix tests * port missing at-range tests to at-current-range * remove at-range tests * fix raw serializer tests * fix linter * fix to prefer toJSON as the canonical method name * fix todos * remove internal references to Raw * add deprecation helper to Text.fromJSON * convert examples to not use Raw, and not rely on terse * remove focus-blur example, rename large document example * refactor Raw serialize to deprecate, not remove, terse * deprecate defaultBlockType, toRaw, cleanup serializers
43 lines
1.2 KiB
JSON
43 lines
1.2 KiB
JSON
{
|
|
"document": {
|
|
"nodes": [
|
|
{
|
|
"kind": "block",
|
|
"type": "paragraph",
|
|
"nodes": [
|
|
{
|
|
"kind": "text",
|
|
"ranges": [
|
|
{
|
|
"text": "In addition to nodes that contain editable text, you can also create other types of nodes, like images or videos."
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"kind": "block",
|
|
"type": "image",
|
|
"isVoid": true,
|
|
"data": {
|
|
"src": "https://img.washingtonpost.com/wp-apps/imrs.php?src=https://img.washingtonpost.com/news/speaking-of-science/wp-content/uploads/sites/36/2015/10/as12-49-7278-1024x1024.jpg&w=1484"
|
|
}
|
|
},
|
|
{
|
|
"kind": "block",
|
|
"type": "paragraph",
|
|
"nodes": [
|
|
{
|
|
"kind": "text",
|
|
"ranges": [
|
|
{
|
|
"text": "This example shows images in action. It features two ways to add images. You can either add an image via the toolbar icon above, or if you want in on a little secret, copy an image URL to your keyboard and paste it anywhere in the editor!"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|