mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 07:04:45 -04:00
Update dependency markmap-lib to v0.9.2 (#707)
* Update dependency markmap-lib to v0.9.2 Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
3b50a00021
commit
47f84f1933
6 changed files with 9 additions and 15 deletions
|
@ -45,17 +45,20 @@ export const MarkmapFrame: React.FC<MarkmapFrameProps> = ({ code }) => {
|
|||
svg.setAttribute('width', '100%')
|
||||
actualContainer.querySelectorAll('svg').forEach(child => child.remove())
|
||||
actualContainer.appendChild(svg)
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
|
||||
const { root, features } = transform.transform(code)
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-assignment
|
||||
const { styles, scripts } = transform.getUsedAssets(features)
|
||||
if (styles) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
||||
loader.loadCSS(styles)
|
||||
}
|
||||
if (scripts) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-member-access
|
||||
loader.loadJS(scripts, { getMarkmap: () => view.Markmap })
|
||||
.catch(err => console.error(err))
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
|
||||
view.Markmap.create(svg, {}, root)
|
||||
}).catch(() => { console.error('error while loading markmap') })
|
||||
}, [code])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue