-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Links in plantuml don't seem to be rendered anymore #21
Comments
I have done some analysis and it looks like cheerio removes the in
this svg variable has
In the next line
when I print the
|
This looks like https://github.com/baerrach/gatsby-remark-plantuml#with-gatsby-plugin-mdx The way this plugin works is to hack the html into the gatsby output stream, but it doesn't get processed properly by the React framework and there are some quirky edgecases where things fall apart. As listed in some of the links in the bullet list, the correct way to do this is to right a MDX component that understands react and replaces the tasks with react SVG tags. However that is way more work than I want to invest in this plugin. Pull Requests welcome. |
@baerrach Understood, but I think I have a quick fix within what you have already written the following worked for me. just needed to change line
to
Now I get the following when I inspect the link (note the extra
And yes the link works now - in safari, chrome and Firefox as tested. It's not perfect as you state above, but good enough for now. Is this acceptable as a quick fix for now? If yes are you ok to add this in or should I raise this a pull request? EDIT: Adding a screenshot for your reference |
Yes, pull request welcome. Also check the test results |
Still working on the pull request. In the meantime I have created a patch using the excellent patch-package (https://github.com/ds300/patch-package) so that Copy the below and put it in
|
I am not sure when this happened, but I believe it is related to the upgrade of Gatsby to the latest version 2.31.1
Previously links in plantuml would appear with in the
<svg/>
tag as<a href=<link> xlink:href=link>
when inspected on the browser page.Now it just appears as
<a xLinkHref= >
which is the react specification - but this appears when I inspect the link on the browser dev console, which suggests that this is not being processed into the html spec by GatsbyWhen I use the plantuml jar directly I get the original svg as before.
So my thoughts are
I just wonder if this means that Gatsby bypasses the output returned by the plugin now and just takes it directly? Have others seen this issue?
an example of a plantuml diagram with a link: http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuNBAJrBGjLDmpCbCJbMmKeYEJi_FJyz9rKlEprN8ICt9oO-DvN98pKi1gWK0
the link looks like this in regular plantuml rendered html
however on gatsby when inspect the link it shows up as below - and the link just behaves like text
I vaguely remember that links inside svg had
href
as an attribute in thea
tag previously in the Gatsby rendered page when inspected them - so I am guessing something must have changed in Gatsby. Is the fixable in this plugin or should I raise an issue in the Gatsby GitHub repo?The text was updated successfully, but these errors were encountered: