xiguaxigua / docusaurus-plugin-drawio

drawio render for docusaurus
https://xiguaxigua.com/docusaurus-plugin-drawio
MIT License
37 stars 10 forks source link

Request to MathJax.js responds with 404 and breaks the viewer #10

Open ddadaal opened 1 year ago

ddadaal commented 1 year ago

Describe the bug

The plugin is currently broken seemingly because viewer.js requests a MathJax.js from https://app.diagrams.net/math/MathJax.js?config=TeX-MML-AM_SVG-full which is now 404. Since the viewer.js is maintained in this repo, should this issue be resolved from here?

Thanks!

To Reproduce

The demo page is already broken. The viewer is not shown.

Expected behavior

The viewer should appear and show the image.

Screenshots

image

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

Derison commented 1 year ago

Can confirm this on my side.

OS: Max OS X Browser: Chrome Version: 116.0.5845.140

migmolrod commented 9 months ago

I can also confirm this in Linux. I can't make it work with anything "chrome-like" (I've tried Chrome, Thorium and Vivaldi).

But with Firefox I have found a very weird behavior:

When I tried to show several pages of the same diagram, I noticed that the first one appears to be blank (and when you click the "Fullscreen" button, it appears there; it's just the embedded drawio which doesn't work).

The rest, though, appears perfectly. Both in the embedded viewer and in fullscreen. So I ended up with this (very) ugly workaround where I show the first page with opacity 0 and height 1px and then all pages (including the page 0 again), just to ensure it's rendered correctly:

import Drawio from '@theme/Drawio'
import sampleGraph from '!!raw-loader!./assets/test.drawio';

<div style={{opacity: 0, height: "1px"}}>
  <Drawio content={sampleGraph}
          page={0}
          toolbar={"zoom lightbox"}/>
</div>

Leyenda:
<Drawio content={sampleGraph}
        page={0}
        toolbar={"zoom lightbox"}/>

Diagrama de Contexto
<Drawio content={sampleGraph}
        page={1}
        toolbar={"zoom lightbox"}/>

DFD-0
<Drawio content={sampleGraph}
        page={2}
        toolbar={"zoom lightbox"}/>
sevaru commented 5 months ago

@ddadaal Hi Did you manage to find any valuable solution to this problem?