Introduce Markdown extensions (#1614)

* Introduce markdown extensions

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2021-11-15 17:04:49 +01:00 committed by GitHub
parent e9defd60dc
commit 8a8bacc0aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
148 changed files with 1878 additions and 1128 deletions

View file

@ -6,7 +6,7 @@
import type React from 'react'
import { useCallback, useState } from 'react'
import type { LineMarkerPosition } from '../../../markdown-renderer/types'
import type { LineMarkerPosition } from '../../../markdown-renderer/markdown-extension/linemarker/types'
import type { ScrollState } from '../../../editor-page/synced-scroll/scroll-props'
import { useOnUserScroll } from './use-on-user-scroll'
import { useScrollToLineMark } from './use-scroll-to-line-mark'

View file

@ -6,7 +6,7 @@
import type { RefObject } from 'react'
import { useCallback } from 'react'
import type { LineMarkerPosition } from '../../../markdown-renderer/types'
import type { LineMarkerPosition } from '../../../markdown-renderer/markdown-extension/linemarker/types'
import type { ScrollState } from '../../../editor-page/synced-scroll/scroll-props'
export const useOnUserScroll = (

View file

@ -6,7 +6,7 @@
import type { RefObject } from 'react'
import { useCallback, useEffect, useRef } from 'react'
import type { LineMarkerPosition } from '../../../markdown-renderer/types'
import type { LineMarkerPosition } from '../../../markdown-renderer/markdown-extension/linemarker/types'
import type { ScrollState } from '../../../editor-page/synced-scroll/scroll-props'
import { findLineMarks } from '../../../editor-page/synced-scroll/utils'

View file

@ -6,7 +6,7 @@
import type React from 'react'
import { useCallback } from 'react'
import type { ImageClickHandler } from '../../markdown-renderer/replace-components/image/image-replacer'
import type { ImageClickHandler } from '../../markdown-renderer/markdown-extension/image/proxy-image-replacer'
import type { RendererToEditorCommunicator } from '../window-post-message-communicator/renderer-to-editor-communicator'
import { CommunicationMessageType } from '../window-post-message-communicator/rendering-message'

View file

@ -9,7 +9,7 @@ import type { ScrollState } from '../editor-page/synced-scroll/scroll-props'
import type { BaseConfiguration } from './window-post-message-communicator/rendering-message'
import { CommunicationMessageType, RendererType } from './window-post-message-communicator/rendering-message'
import { setDarkMode } from '../../redux/dark-mode/methods'
import type { ImageClickHandler } from '../markdown-renderer/replace-components/image/image-replacer'
import type { ImageClickHandler } from '../markdown-renderer/markdown-extension/image/proxy-image-replacer'
import { useImageClickHandler } from './hooks/use-image-click-handler'
import { MarkdownDocument } from './markdown-document'
import { countWords } from './word-counter'

View file

@ -12,7 +12,7 @@ import { YamlArrayDeprecationAlert } from '../editor-page/renderer-pane/yaml-arr
import { useDocumentSyncScrolling } from './hooks/sync-scroll/use-document-sync-scrolling'
import type { ScrollProps } from '../editor-page/synced-scroll/scroll-props'
import { DocumentMarkdownRenderer } from '../markdown-renderer/document-markdown-renderer'
import type { ImageClickHandler } from '../markdown-renderer/replace-components/image/image-replacer'
import type { ImageClickHandler } from '../markdown-renderer/markdown-extension/image/proxy-image-replacer'
import './markdown-document.scss'
import { WidthBasedTableOfContents } from './width-based-table-of-contents'
import { ShowIf } from '../common/show-if/show-if'
@ -61,7 +61,7 @@ export const MarkdownDocument: React.FC<MarkdownDocumentProps> = ({
const [tocAst, setTocAst] = useState<TocAst>()
const useAlternativeBreaks = useApplicationState((state) => state.noteDetails.frontmatter.breaks)
const newlinesAreBreaks = useApplicationState((state) => state.noteDetails.frontmatter.newlinesAreBreaks)
useEffect(() => {
if (!onHeightChange) {
@ -99,7 +99,7 @@ export const MarkdownDocument: React.FC<MarkdownDocumentProps> = ({
onTocChange={setTocAst}
baseUrl={baseUrl}
onImageClick={onImageClick}
useAlternativeBreaks={useAlternativeBreaks}
newlinesAreBreaks={newlinesAreBreaks}
lineOffset={frontmatterInfo?.lineOffset}
/>
</div>