-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Cannot center-justify text in nodes #958
Comments
Note that the |
Sounds like a broken feature, if you have to disable the security, no? If we are not supposed to use |
Just to be clear, I use mermaid in my github wikis and there's no way to put this extra config, specially I use a Chrome plugin to render it dynamically. It really sounds like a missing/broken feature. |
Hey, my answer was only directed to the fact that the tag gets written as text in the node instead of actually being a tag. This is because you are working on strict security level. Also the fact that the This does not provide a solution to how to center-justify text in nodes and, it appers to be, there is none. It's just a missing feature. Even when using the |
I think we should investigate this one further. Maybe something like this:
What needs to be investigated is if there is some nifty css to align the text. When using htmlLabels this should be possible. Note that the dot notation means tha the class is attached to the node. |
I think the issue lays in the fact that style properties are applied only to the "node" (rect, box, etc...) and so they don't affect the label which is not inside the "node". |
- assign text-align style to text node to allow aligning of node text
The "color" property is already applied at the text node level. I added that for text-align as well in a PR. |
- changed fit() to it() to reactivate test
- assign text-align style to text node to allow aligning of node text
- changed fit() to it() to reactivate test
#958 Cannot center-justify text in nodes
Describe the bug
I'm basically reopening this issue: #397 because the original solution is no longer working and the discussion thread has been blocked.
To Reproduce
Steps to reproduce the behavior:
Try here
Expected behavior
We can see that
<br>
html tag was properly rendered, but the<center>
tag isn't. We would need a native solution (without<script>
tag) to allow this to work (not necessarily<center>
, it could be done withstyle
operation for instance.Screenshots
Desktop/Mobile
The text was updated successfully, but these errors were encountered: