Skip to content

Commit

Permalink
added turn into code block without language recognition
Browse files Browse the repository at this point in the history
  • Loading branch information
iskaktoltay committed Nov 22, 2024
1 parent 6913357 commit dd696b5
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {Forward, RefreshCcw, XStack} from '@shm/ui'
import * as _ from 'lodash'
import {useCallback, useRef, useState} from 'react'
import {
RiChatQuoteFill,
RiChatQuoteLine,
RiCodeBoxLine,
RiHeading,
RiListOrdered,
RiListUnordered,
Expand Down Expand Up @@ -144,6 +145,24 @@ var turnIntoItems = [
})
},
},
{
label: 'Code',
group: 'Block operations',
Icon: RiCodeBoxLine,
onClick: ({
block,
editor,
}: {
block: Block<HMBlockSchema>
editor: BlockNoteEditor<HMBlockSchema>
}) => {
editor.focus()
editor.updateBlock(block, {
type: 'code-block',
props: {},
})
},
},
// {
// label: 'Block Quote',
// group: 'Group operations',
Expand Down Expand Up @@ -208,7 +227,7 @@ var turnIntoItems = [
{
label: 'Blockquote item',
group: 'Group operations',
Icon: RiChatQuoteFill,
Icon: RiChatQuoteLine,
onClick: ({
block,
editor,
Expand Down

0 comments on commit dd696b5

Please sign in to comment.