mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-12 11:59:39 +02:00
#1212 Class definition is not applied to flowchart nodes with links
This commit is contained in:
@@ -374,6 +374,7 @@ describe('Flowchart', () => {
|
|||||||
click B testClick "click test"
|
click B testClick "click test"
|
||||||
classDef someclass fill:#f96;
|
classDef someclass fill:#f96;
|
||||||
class A someclass;
|
class A someclass;
|
||||||
|
class C someclass;
|
||||||
`,
|
`,
|
||||||
{
|
{
|
||||||
listUrl: false,
|
listUrl: false,
|
||||||
@@ -409,7 +410,9 @@ describe('Flowchart', () => {
|
|||||||
click A "index.html#link-clicked" "link test"
|
click A "index.html#link-clicked" "link test"
|
||||||
click B testClick "click test"
|
click B testClick "click test"
|
||||||
classDef someclass fill:#f96;
|
classDef someclass fill:#f96;
|
||||||
class A someclass;`,
|
class A someclass;
|
||||||
|
class C someclass;
|
||||||
|
`,
|
||||||
{ flowchart: { htmlLabels: false } }
|
{ flowchart: { htmlLabels: false } }
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
2
dist/index.html
vendored
2
dist/index.html
vendored
@@ -299,6 +299,7 @@ click A "index.html#link-clicked" "link test"
|
|||||||
click B testClick "click test"
|
click B testClick "click test"
|
||||||
classDef someclass fill:#f96;
|
classDef someclass fill:#f96;
|
||||||
class A someclass;
|
class A someclass;
|
||||||
|
class C someclass;
|
||||||
</div>
|
</div>
|
||||||
<div class="mermaid">
|
<div class="mermaid">
|
||||||
graph TD
|
graph TD
|
||||||
@@ -312,6 +313,7 @@ class A someclass;
|
|||||||
click B testClick "click test"
|
click B testClick "click test"
|
||||||
classDef someclass fill:#f96;
|
classDef someclass fill:#f96;
|
||||||
class A someclass;
|
class A someclass;
|
||||||
|
class C someclass;
|
||||||
</div>
|
</div>
|
||||||
<div class="mermaid">
|
<div class="mermaid">
|
||||||
graph LR
|
graph LR
|
||||||
|
@@ -461,6 +461,7 @@ export const draw = function(text, id) {
|
|||||||
const node = d3.select('#' + id + ' [id="' + key + '"]');
|
const node = d3.select('#' + id + ' [id="' + key + '"]');
|
||||||
if (node) {
|
if (node) {
|
||||||
const link = document.createElementNS('http://www.w3.org/2000/svg', 'a');
|
const link = document.createElementNS('http://www.w3.org/2000/svg', 'a');
|
||||||
|
link.setAttributeNS('http://www.w3.org/2000/svg', 'class', vertex.classes.join(' '));
|
||||||
link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link);
|
link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link);
|
||||||
link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener');
|
link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener');
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user