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

FontAwesome support for when htmlLabels=false #528

Closed
JohnLBevan opened this issue Apr 25, 2017 · 1 comment
Closed

FontAwesome support for when htmlLabels=false #528

JohnLBevan opened this issue Apr 25, 2017 · 1 comment
Labels
Type: New Shape Request for new shape

Comments

@JohnLBevan
Copy link

Font awesome characters are not shown; rather the code (e.g. fa:fa-server) appears, when htmllabels is set to false.
This has a knock on effect that the text no longer fits in the box.

With htmllabels set to true all works (though not in IE11; per #303).


Workaround:

Use the following code so we only set htmllabels to false when using IE:

var config = {
    startOnLoad: true,
    flowchart: {
        useMaxWidth: false,
        htmlLabels: (!IsIE()) //this line is key
    }
};
mermaid.initialize(config);

Related IsIE function would be something like this:

function IsIE() { //other functions are available: http://stackoverflow.com/questions/19999388/check-if-user-is-using-ie-with-jquery
    return (navigator.appName == 'Microsoft Internet Explorer' || navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0);
}
@stale
Copy link

stale bot commented Jun 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Type: New Shape Request for new shape label Jun 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Shape Request for new shape
Projects
None yet
Development

No branches or pull requests

1 participant