Skip to content
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

Issue with mermaid along with ngx-markdown #980

Closed
arora-kushal opened this issue Oct 7, 2019 · 3 comments
Closed

Issue with mermaid along with ngx-markdown #980

arora-kushal opened this issue Oct 7, 2019 · 3 comments
Assignees
Labels
Type: Other Not an enhancement or a bug

Comments

@arora-kushal
Copy link

This is related to bug: #979

Issue #1: Its not working in Firefox.

image

Issue #2: Please see the output of chrome. Why these 2 diagrams are different given the same sequence code.

image

@arora-kushal arora-kushal added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Oct 7, 2019
@IOrlandoni
Copy link
Member

IOrlandoni commented Oct 7, 2019

Hey, apologies if I closed your other issue prematurely.

For your second issue, by removing the call to mermaid.init(), I noted that you're not generating the same sequence code.
image

@IOrlandoni
Copy link
Member

As for your first issue, I suspect the markup is being included in the page after mermaid has already run. In which case, you should be able to fix it by changing the event you're using to initialize mermaid.

As I have no experience with angular I could not say which are the other options.

@IOrlandoni IOrlandoni added Status: Pending Is not to be executed as it currently is Type: Other Not an enhancement or a bug and removed Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Oct 7, 2019
@arora-kushal
Copy link
Author

Thanks @dunning-kruger for your help.. I have fixed this after reading your suggestions.

The solution:
Instead of using markdown like this
<markdown [src]="'path/to/file.md'"></markdown>
I have used this like
<div markdown [src]="'path/to/file.md'" (load)="onLoad($event)" ></div>

and in TS file

onLoad(event) {
    mermaid.init();
    mermaid.initialize({
      securityLevel: 'loose'
    });
  }

@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2019
@IOrlandoni IOrlandoni self-assigned this Dec 11, 2019
@IOrlandoni IOrlandoni removed the Status: Pending Is not to be executed as it currently is label Dec 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Other Not an enhancement or a bug
Projects
None yet
Development

No branches or pull requests

2 participants