-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Allow "target=_blank" in the note of classDiagram #4716
Comments
Hey, this seems to be a very easy issue as to what I have perceived until now. Could you please explain me the issue better if possible. I am new to contribution to such large codebases. Regards, |
@VividhPandey003
A note can have an HTML label in it, which will result as embedded
And if we add
...rendered element will have an
|
Hello , I want to try some workarounds to solve this issue , I want to deploy it locally and deployment part is not mentioned in the documentation. Where can i find the documentation to deploy it on localhost so i can work on issue. Best regards, |
Hello, @parthesh-tiwari There is a guide for setting up this locally for development, let us know if you are looking for something else. |
Thanks @nirname , will surely let know if i need anything |
The issue is mermaid repo right? |
hello @nirname Thanks |
Hi @dharmik3504, @preetsahil! I have not reproduced this issue personally. You still have to find the exact place in the code. Highly likely it is related to this very repository, because live editor is not responsible for the rendering by itself. May be live editor it is not updated to the latest version of Mermaid or something else.
So check it. Set up the project for local development, add or update the example you want to debug at a demo page, open your browser and you will see if it works or not. In case it is not, not let us know, and we will close this issue. Otherwise, feel free to open PR with the changes. Feel free to ask if you face any problems during deployment process. This is probably the most intimidating part of the contribution |
how to get it setup in http://localhost:9000/dev/example.html code? I mean where to paste or how to configure the code
|
@amnahid you should edit the code inside |
@nirname Yeah this bug is valid, can you assign me to start working on it? |
@amnahid No need to assign, you can dive in. Sometimes people get stuck while solving task or having some troubles continuing. Lets leave it unassigned so that the others could take their chances on the task. You can open PR, even in the middle of the process and mark it as a draft. If case you write |
@nirname at first I thought the bug was occuring for dompurify package since it was removing the export const sanitizeText = (text: string, config: MermaidConfig): string => {
// if (!text) {
// return text;
// }
// if (config.dompurifyConfig) {
// text = DOMPurify.sanitize(sanitizeMore(text, config), config.dompurifyConfig).toString();
// } else {
// text = DOMPurify.sanitize(sanitizeMore(text, config), {
// FORBID_TAGS: ['style'],
// }).toString();
// }
return text;
}; Although on the console log Can you explain how render is happened there? |
@amnahid I have not tracked the problem down further than you had. It is possible that dagre-d3-es or dagre-wrapper somehow change the nodes |
@amnahid I have performed debugging and have found out that removing sanitizeText at v2 class renderer was not enough, because it was also called in two other places for markdown and html labels. That means, we have to either alter sanitization function to our needs or rework that label helper as well as rendering function. Actually, some hacks are already out there tackling the similar problems for flowchart. |
@nirname when I was logging on markdown I was getting nothing (I mean no output) and same as html. When I was logging in decodeEntities() there was no Can it getting removed somewhere else? |
@amnahid I think you have to debug |
Hi @nirname I've did the necessary changes but for some reason I'm not able to commit those. It's getting stuck on linting stage, is there anything specific I need to do. PFA the video shows the issue is fixed. Screen.Recording.2023-10-08.at.6.16.48.PM.mov |
@REVERB283 Nicely done. I am afraid I cannot help with linting. You can always call linting step separately from git pre-commit hooks, using |
@nirname any update on the MR review, also can you please assign it to me? |
@REVERB283 no worries, attached PR is enough, and you can save this issue as a bookmark in GH |
Description
There is no attr 'target' in the rendered page. When using classDiagram, links are required to open in new tabs.
Steps to reproduce
Using the live editor: https://mermaid.live/edit#pako:eNpNkMtuhDAMRX8FecMGAYHySMSwapdddVdFqtwhPKZAUDBSp4h_bwZQVW9sH1v3Wl7hqisFAq49zvNzh43BQY6OjZ04pGZy1oNsRxo1KafW5phJKNBpjaovbks0zSIIBmUG7Cr_NvvaNIHrEJpG0cX9-Oxx_HLLc6EIHuZlEWApATw4sb1mN5RArRqUBGHLStW49CRBjptdxYX02328giCzKA-WqUJS5_0gauxnSyccQazwDSJmuR_mYRixjGcszVIP7iAsjHjIo4QlcR4lYRxtHvxobRVCP-VPCY_yOE5YznPGd7n3ffjf86XqSJs_S7W3r-dTH2n7BaVdb7M
Screenshots
No response
Code Sample
No response
Setup
Suggested Solutions
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: