Skip to content

Commit 8021475

Browse files
authored
Merge pull request #553 from Harbour-Enterprises/feat/format/add-italic-and-underline
feat(ai): Add support for italic and underline text formatting in AI …
2 parents 38284a1 + 86c282a commit 8021475

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

packages/super-editor/src/components/toolbar/ai-helpers.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,24 @@ const formatRegistry = {
312312
text: content,
313313
}),
314314
},
315+
{
316+
name: 'italic',
317+
pattern: /\*(.*?)\*/g,
318+
transform: (_match, content, _editor) => ({
319+
type: 'text',
320+
marks: [{ type: 'italic' }],
321+
text: content,
322+
}),
323+
},
324+
{
325+
name: 'underline',
326+
pattern: /<(?:u|ins)>(.*?)<\/(?:u|ins)>/g,
327+
transform: (_match, content, _editor) => ({
328+
type: 'text',
329+
marks: [{ type: 'underline' }],
330+
text: content,
331+
}),
332+
},
315333
],
316334
};
317335

0 commit comments

Comments
 (0)