mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 23:24:46 -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
|
@ -7,13 +7,13 @@ import { PdfFrame } from './pdf-frame'
|
|||
export class PdfReplacer extends ComponentReplacer {
|
||||
private counterMap: Map<string, number> = new Map<string, number>()
|
||||
|
||||
public getReplacement (node: DomElement, index: number): React.ReactElement | undefined {
|
||||
public getReplacement (node: DomElement): React.ReactElement | undefined {
|
||||
const attributes = getAttributesFromHedgeDocTag(node, 'pdf')
|
||||
if (attributes && attributes.url) {
|
||||
const pdfUrl = attributes.url
|
||||
const count = (this.counterMap.get(pdfUrl) || 0) + 1
|
||||
this.counterMap.set(pdfUrl, count)
|
||||
return <PdfFrame key={index} url={pdfUrl}/>
|
||||
return <PdfFrame url={pdfUrl}/>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue