Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simple latex block #818

Closed
wants to merge 14 commits into from
Next Next commit
fix: node conversion
  • Loading branch information
jkcs committed Jun 4, 2024
commit 61f3ec7ca78acdff8396e67a0c4c3d4da33d615e
2 changes: 1 addition & 1 deletion examples/05-custom-schema/01-alert-block/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function App() {
},
{
type: "alert",
content: "This is an example alert",
content: "This is an example /n alert",
},
{
type: "paragraph",
Expand Down
2 changes: 1 addition & 1 deletion examples/05-custom-schema/01-alert-block/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
align-items: center;
flex-grow: 1;
border-radius: 4px;
height: 48px;
min-height: 48px;
padding: 4px;
}

Expand Down
6 changes: 2 additions & 4 deletions packages/core/src/api/nodeConversions/nodeConversions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,8 @@ function blockOrInlineContentToContentNode(
if (!block.content) {
contentNode = schema.nodes[type].create(block.props);
} else if (typeof block.content === "string") {
contentNode = schema.nodes[type].create(
block.props,
schema.text(block.content)
);
const nodes = inlineContentToNodes([block.content], schema, styleSchema);
contentNode = schema.nodes[type].create(block.props, nodes);
} else if (Array.isArray(block.content)) {
const nodes = inlineContentToNodes(block.content, schema, styleSchema);
contentNode = schema.nodes[type].create(block.props, nodes);
Expand Down