Merge pull request #2139 from omnivore-app/fix/web-notebook-handling

Better handling of the tab keypress in notebooks
This commit is contained in:
Jackson Harper 2023-04-28 20:40:10 +08:00 committed by GitHub
commit b92a053f1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,7 +11,7 @@ import { formattedShortTime } from '../../lib/dateFormatting'
import { HStack, SpanBox, VStack } from '../elements/LayoutPrimitives'
import MarkdownIt from 'markdown-it'
import MdEditor from 'react-markdown-editor-lite'
import MdEditor, { Plugins } from 'react-markdown-editor-lite'
import 'react-markdown-editor-lite/lib/index.css'
import ReactMarkdown from 'react-markdown'
import throttle from 'lodash/throttle'
@ -29,6 +29,10 @@ import remarkGfm from 'remark-gfm'
const mdParser = new MarkdownIt()
MdEditor.use(Plugins.TabInsert, {
tabMapValue: 1, // note that 1 means a '\t' instead of ' '.
})
type NoteSectionProps = {
placeHolder: string
mode: 'edit' | 'preview'
@ -212,6 +216,7 @@ export function MarkdownNote(props: MarkdownNote): JSX.Element {
hideMenu: false,
}}
plugins={[
'tab-insert',
'header',
'font-bold',
'font-italic',