mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 11:37:02 -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
|
@ -13,7 +13,7 @@ export interface CheatsheetLineProps {
|
|||
}
|
||||
|
||||
const HighlightedCode = React.lazy(
|
||||
() => import('../../../markdown-renderer/replace-components/highlighted-fence/highlighted-code/highlighted-code')
|
||||
() => import('../../../markdown-renderer/markdown-extension/highlighted-fence/highlighted-code')
|
||||
)
|
||||
const DocumentMarkdownRenderer = React.lazy(() => import('../../../markdown-renderer/document-markdown-renderer'))
|
||||
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
|
||||
import type { Editor, Hint, Hints } from 'codemirror'
|
||||
import { Pos } from 'codemirror'
|
||||
import { validAlertLevels } from '../../../markdown-renderer/markdown-it-plugins/alert-container'
|
||||
import type { Hinter } from './index'
|
||||
import { findWordAtCursor } from './index'
|
||||
import { alertLevels } from '../../../markdown-renderer/markdown-extension/alert-markdown-extension'
|
||||
|
||||
const wordRegExp = /^:::((?:\w|-|\+)*)$/
|
||||
const spoilerSuggestion: Hint = {
|
||||
text: ':::spoiler Toggle label\nToggled content\n::: \n',
|
||||
displayText: 'spoiler'
|
||||
}
|
||||
const suggestions = validAlertLevels
|
||||
const suggestions = alertLevels
|
||||
.map(
|
||||
(suggestion: string): Hint => ({
|
||||
text: ':::' + suggestion + '\n\n::: \n',
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
import React, { useCallback, useState } from 'react'
|
||||
import { ImageLightboxModal } from '../../markdown-renderer/replace-components/image/image-lightbox-modal'
|
||||
import { ImageLightboxModal } from '../../markdown-renderer/markdown-extension/image/image-lightbox-modal'
|
||||
import type {
|
||||
ImageClickedMessage,
|
||||
ImageDetails
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { LineMarkerPosition } from '../../markdown-renderer/types'
|
||||
import type { LineMarkerPosition } from '../../markdown-renderer/markdown-extension/linemarker/types'
|
||||
|
||||
export const findLineMarks = (
|
||||
lineMarks: LineMarkerPosition[],
|
||||
|
|
|
@ -8,8 +8,8 @@ import type { TocAst } from 'markdown-it-toc-done-right'
|
|||
import type { ReactElement } from 'react'
|
||||
import React, { Fragment } from 'react'
|
||||
import { ShowIf } from '../../common/show-if/show-if'
|
||||
import { createJumpToMarkClickEventHandler } from '../../markdown-renderer/replace-components/link-replacer/link-replacer'
|
||||
import { tocSlugify } from './toc-slugify'
|
||||
import { JumpAnchor } from '../../markdown-renderer/markdown-extension/link-replacer/jump-anchor'
|
||||
|
||||
export const buildReactDomFromTocAst = (
|
||||
toc: TocAst,
|
||||
|
@ -32,9 +32,9 @@ export const buildReactDomFromTocAst = (
|
|||
const content = (
|
||||
<Fragment>
|
||||
<ShowIf condition={toc.l > 0}>
|
||||
<a href={headlineUrl} title={rawName} onClick={createJumpToMarkClickEventHandler(slug.substr(1))}>
|
||||
<JumpAnchor href={headlineUrl} title={rawName} jumpTargetId={slug.substr(1)}>
|
||||
{rawName}
|
||||
</a>
|
||||
</JumpAnchor>
|
||||
</ShowIf>
|
||||
<ShowIf condition={toc.c.length > 0}>
|
||||
<ul>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue