mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
fix: long strings in firefox
This commit is contained in:
parent
b1b480a13b
commit
46d612d135
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mermaid",
|
||||
"version": "11.0.0-alpha.7",
|
||||
"version": "11.0.0-alpha.7+",
|
||||
"description": "Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.",
|
||||
"type": "module",
|
||||
"module": "./dist/mermaid.core.mjs",
|
||||
|
@ -104,6 +104,7 @@ export const labelHelper = async (parent, node, _classes, isNode) => {
|
||||
bbox = div.getBoundingClientRect();
|
||||
dv.attr('width', bbox.width);
|
||||
dv.attr('height', bbox.height);
|
||||
dv.style('height', bbox.height + 'px');
|
||||
}
|
||||
|
||||
// Center the label
|
||||
|
@ -40,11 +40,14 @@ function addHtmlSpan(element, node, width, classes, addBackground = false) {
|
||||
div.style('display', 'table');
|
||||
div.style('white-space', 'break-spaces');
|
||||
div.style('width', width + 'px');
|
||||
bbox = div.node().getBoundingClientRect();
|
||||
const newBbox = div.node().getBoundingClientRect();
|
||||
if (newBbox.height > 0) {
|
||||
bbox = newBbox;
|
||||
}
|
||||
}
|
||||
|
||||
fo.style('width', bbox.width);
|
||||
fo.style('height', bbox.height);
|
||||
fo.style('width', bbox.width + 'px');
|
||||
fo.style('height', bbox.height + 'px');
|
||||
|
||||
return fo.node();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user