Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/09-ai/02-playground/src/data/aimodels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const AI_MODELS = [
"mistral.chat/mistral-medium-latest",
"mistral.chat/ministral-3b-latest",
"mistral.chat/ministral-8b-latest",
"anthropic.chat/claude-opus-4-1",
"anthropic.chat/claude-sonnet-4-0",
"anthropic.chat/claude-opus-4-5",
"anthropic.chat/claude-sonnet-4-5",
"anthropic.chat/claude-3-7-sonnet-latest",
"anthropic.chat/claude-3-5-haiku-latest",
"albert-etalab.chat/albert-large",
Expand Down
11 changes: 11 additions & 0 deletions packages/core/src/api/parsers/markdown/parseMarkdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ export function markdownToHTML(markdown: string): string {
}
},
code,
blockquote: (state: any, node: any) => {
const result = {
type: "element",
tagName: "blockquote",
properties: {},
// The only difference from the original is that we don't wrap the children with line endings
children: state.wrap(state.all(node), false),
};
state.patch(node, result);
return state.applyData(node, result);
},
},
})
.use(rehypeStringify)
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/schema/blocks/createSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export function getParseRules<
const parser = DOMParser.fromSchema(schema);
const parsed = parser.parse(clone, {
topNode: schema.nodes.paragraph.create(),
preserveWhitespace: true,
});

return parsed.content;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ export function createUpdateBlockTool<T>(config: {
const block = editor.getBlock(id);

if (!block) {
// eslint-disable-next-line no-console
console.error("BLOCK NOT FOUND", id);
return {
ok: false,
error: "block not found",
error: new Error("Block not found (update)", {
cause: {
blockId: id,
},
}),
};
}

Expand Down
6 changes: 5 additions & 1 deletion packages/xl-ai/src/api/formats/base-tools/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ export const deleteBlockTool = (
if (!block) {
return {
ok: false,
error: "block not found",
error: new Error("Block not found (delete)", {
cause: {
blockId: id,
},
}),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ export async function createHTMLRebaseTool(
);

if (steps.length) {
// console.error("html diff", steps);
throw new Error("html diff");
throw new Error("html diff", {
cause: {
html,
htmlBlock
}
});
}

return rebaseTool(editor, tr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
{
"styles": {},
"text": "Table Cell
Table Cell Table Cell",
Table Cell

Table Cell
",
"type": "text",
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
"content": [
{
"styles": {},
"text": "Paragraph With Hard Break",
"text": "Paragraph
With Hard Break",
"type": "text",
},
],
Expand Down
Loading