mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-21 10:45:20 -04:00
Adapt react-client to use the real backend API (#1545)
Co-authored-by: Philip Molares <philip.molares@udo.edu> Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
3399ed2023
commit
26f90505ff
227 changed files with 4726 additions and 2310 deletions
|
@ -13,7 +13,7 @@ const log = new Logger('DebuggerMarkdownExtension')
|
|||
|
||||
export class DebuggerMarkdownExtension extends MarkdownExtension {
|
||||
public configureMarkdownItPost(markdownIt: MarkdownIt): void {
|
||||
if (isDevMode()) {
|
||||
if (isDevMode) {
|
||||
markdownIt.core.ruler.push('printStateToConsole', (state) => {
|
||||
log.debug('Current state', state)
|
||||
return false
|
||||
|
|
|
@ -20,7 +20,7 @@ export const ProxyImageFrame: React.FC<React.ImgHTMLAttributes<HTMLImageElement>
|
|||
return
|
||||
}
|
||||
getProxiedUrl(src)
|
||||
.then((proxyResponse) => setImageUrl(proxyResponse.src))
|
||||
.then((proxyResponse) => setImageUrl(proxyResponse.url))
|
||||
.catch((err) => log.error(err))
|
||||
}, [imageProxyEnabled, src])
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
import { MarkdownExtension } from '../markdown-extension'
|
||||
import type MarkdownIt from 'markdown-it'
|
||||
import plantuml from 'markdown-it-plantuml'
|
||||
import type { RenderRule } from 'markdown-it/lib/renderer'
|
||||
import type Renderer from 'markdown-it/lib/renderer'
|
||||
import type Token from 'markdown-it/lib/token'
|
||||
import type { Options } from 'markdown-it/lib'
|
||||
|
@ -15,12 +14,12 @@ import type { ComponentReplacer } from '../../replace-components/component-repla
|
|||
import { PlantumlNotConfiguredComponentReplacer } from './plantuml-not-configured-component-replacer'
|
||||
|
||||
export class PlantumlMarkdownExtension extends MarkdownExtension {
|
||||
constructor(private plantumlServer: string | null) {
|
||||
constructor(private plantumlServer?: string) {
|
||||
super()
|
||||
}
|
||||
|
||||
private plantumlError(markdownIt: MarkdownIt): void {
|
||||
const defaultRenderer: RenderRule = markdownIt.renderer.rules.fence || (() => '')
|
||||
const defaultRenderer: Renderer.RenderRule = markdownIt.renderer.rules.fence || (() => '')
|
||||
markdownIt.renderer.rules.fence = (tokens: Token[], idx: number, options: Options, env, slf: Renderer) => {
|
||||
return tokens[idx].info === 'plantuml'
|
||||
? '<plantuml-not-configured></plantuml-not-configured>'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue