mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 07:04:45 -04:00
Remove keys from replacers (#539)
This commit is contained in:
parent
63b24fa5bf
commit
e58e53a116
20 changed files with 77 additions and 78 deletions
|
@ -4,13 +4,13 @@ import { ComponentReplacer } from '../ComponentReplacer'
|
|||
import { FlowChart } from './flowchart/flowchart'
|
||||
|
||||
export class FlowchartReplacer extends ComponentReplacer {
|
||||
public getReplacement (codeNode: DomElement, index: number): React.ReactElement | undefined {
|
||||
public getReplacement (codeNode: DomElement): React.ReactElement | undefined {
|
||||
if (codeNode.name !== 'code' || !codeNode.attribs || !codeNode.attribs['data-highlight-language'] || codeNode.attribs['data-highlight-language'] !== 'flow' || !codeNode.children || !codeNode.children[0]) {
|
||||
return
|
||||
}
|
||||
|
||||
const code = codeNode.children[0].data as string
|
||||
|
||||
return <FlowChart key={`flowchart-${index}`} code={code}/>
|
||||
return <FlowChart code={code}/>
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue