mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 23:54:42 -04:00
Feature/browserstack (#902)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
900affeac2
commit
887c3b9dd3
16 changed files with 404 additions and 86 deletions
|
@ -46,11 +46,15 @@ export const MarkmapFrame: React.FC<MarkmapFrameProps> = ({ code }) => {
|
|||
}
|
||||
const actualContainer = diagramContainer.current
|
||||
import('./markmap-loader').then(({ markmapLoader }) => {
|
||||
const svg: SVGSVGElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg')
|
||||
svg.setAttribute('width', '100%')
|
||||
actualContainer.querySelectorAll('svg').forEach(child => child.remove())
|
||||
actualContainer.appendChild(svg)
|
||||
markmapLoader(svg, code)
|
||||
try {
|
||||
const svg: SVGSVGElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg')
|
||||
svg.setAttribute('width', '100%')
|
||||
actualContainer.querySelectorAll('svg').forEach(child => child.remove())
|
||||
actualContainer.appendChild(svg)
|
||||
markmapLoader(svg, code)
|
||||
} catch(error) {
|
||||
console.error(error)
|
||||
}
|
||||
}).catch(() => {
|
||||
console.error('error while loading markmap')
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue