mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-25 12:34:45 -04:00
Introduce Markdown extensions (#1614)
* Introduce markdown extensions Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
e9defd60dc
commit
8a8bacc0aa
148 changed files with 1878 additions and 1128 deletions
|
@ -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'
|
||||
|
|
|
@ -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 = (
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue