-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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 graph missing #209
Comments
+1 |
With your graph, I see only the lines and not the arrows. ;) |
Yeah, I realized: Just use graphviz, duh (aka: it’s an already solved problem). |
Have you included the mermaid.css? If not that would probably solve your issue. Hope it helps. If this is rendered via the CLI the latest unreleased version includes the stylesheet. |
Arrows not need the CSS file. Here is a strange problem with BASE html-tag. Please create a blank html file and drop this in it:
You will not see any arrows. BUT now remove "XXX" in href of BASE tag and its will work. Strange, or? |
If you look in the svg code for an arrow it will make more sense:
Look at the marker end part where it is actually a url pointing to the definition. Thats why the base path change messes it up. |
Yes. I found this stackoverflow question for this topic: |
I believe it could be fixed by replacing this line https://github.com/knsv/mermaid/blob/fcb2af7/src/diagrams/sequenceDiagram/sequenceRenderer.js#L231: line.attr("marker-end", "url(#arrowhead)"); with: line.attr("marker-end", "url(" + window.location.href + "#arrowhead)"); And the same for the That, at least, is the fix I made for another project (which worked): https://github.com/vega/vega/pull/213/files |
Excellent! Thanks! |
Small issue. The url wont work if the actual url contains a hash section as in http://a.b.c/d#e Using
instead of location.href solves this though so all is well! |
Fix for issue #195, text wrap in sequence diagrams drops last word Documentation
Fix for this issue was released in mermaid 0.5.2. Will close this now, let me know if you issues still remain. |
@knsv, thanks for implementing the fix! However, I think the solution still isn't quite right -- if your URL is something like http://a.b.c/d?e#f, then it returns |
Also, there's the port number to consider... I found a couple of relevant questions on SO: |
You are right. It is easy to underestimate urls. Have you found instances where this does not work? In the end the code that handles this is the following:
The port is included with window.location.host and the hash should be excluded otherwise there is two hashes in the url. My test url: gives: which renders the arrow heads. |
That looks good to me, but I'm not an expert on this topic. This issue came to mind again because I was doing some SVG stuff in a project. I ended up using |
Sounds good! Thanks for keeping mermaid in mind! |
Mitigate XSS vulnerability and allow img tags to be correctly handled in output SVG.
gives
The text was updated successfully, but these errors were encountered: