Skip to content

Commit f45b0e6

Browse files
authored
Merge pull request #109 from datocms/feat/support-inline-blocks
Add support for inline blocks
2 parents c8d39bf + 14a38ed commit f45b0e6

5 files changed

Lines changed: 161 additions & 90 deletions

File tree

package-lock.json

Lines changed: 13 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@
135135
"dependencies": {
136136
"@mux/mux-player-react": "*",
137137
"datocms-listen": "^0.1.9",
138-
"datocms-structured-text-generic-html-renderer": "^4.0.1",
139-
"datocms-structured-text-utils": "^4.0.1",
138+
"datocms-structured-text-generic-html-renderer": "^4.1.2",
139+
"datocms-structured-text-utils": "^4.1.2",
140140
"react-intersection-observer": "^9.4.3",
141141
"react-string-replace": "^1.1.0",
142142
"use-deep-compare-effect": "^1.6.1"

src/StructuredText/__tests__/__snapshots__/index.test.tsx.snap

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ exports[`StructuredText with links/blocks with default rules renders the documen
224224
"id": "456",
225225
"quote": "Foo bar.",
226226
},
227+
{
228+
"__typename": "MentionRecord",
229+
"id": "789",
230+
"name": "Jane Doe",
231+
},
227232
],
228233
"links": [
229234
{
@@ -269,6 +274,10 @@ exports[`StructuredText with links/blocks with default rules renders the documen
269274
],
270275
"type": "itemLink",
271276
},
277+
{
278+
"item": "789",
279+
"type": "inlineBlock",
280+
},
272281
],
273282
"level": 1,
274283
"type": "heading",
@@ -285,6 +294,7 @@ exports[`StructuredText with links/blocks with default rules renders the documen
285294
}
286295
}
287296
renderBlock={[Function]}
297+
renderInlineBlock={[Function]}
288298
renderInlineRecord={[Function]}
289299
renderLinkToRecord={[Function]}
290300
>
@@ -310,6 +320,11 @@ exports[`StructuredText with links/blocks with default rules renders the documen
310320
>
311321
here!
312322
</a>
323+
<em
324+
key="t-4"
325+
>
326+
Jane Doe
327+
</em>
313328
</h1>
314329
<figure
315330
key="t-1"

0 commit comments

Comments
 (0)