mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-14 12:59:46 +02:00
fix: abstract field doesnt make any sense
This commit is contained in:
@@ -274,7 +274,7 @@ export const drawClass = function (elem, classDef, conf) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const parseMember = function (text) {
|
export const parseMember = function (text) {
|
||||||
const fieldRegEx = /^(\+|-|~|#)?(\w+)(~\w+~|\[\])?\s+(\w+) *(\*|\$)?$/;
|
const fieldRegEx = /^(\+|-|~|#)?(\w+)(~\w+~|\[\])?\s+(\w+) *(\$)?$/;
|
||||||
const methodRegEx = /^([+|\-|~|#])?(\w+) *\( *(.*)\) *(\*|\$)? *(\w*[~|[\]]*\s*\w*~?)$/;
|
const methodRegEx = /^([+|\-|~|#])?(\w+) *\( *(.*)\) *(\*|\$)? *(\w*[~|[\]]*\s*\w*~?)$/;
|
||||||
|
|
||||||
let fieldMatch = text.match(fieldRegEx);
|
let fieldMatch = text.match(fieldRegEx);
|
||||||
|
@@ -51,7 +51,7 @@ describe('class member Renderer, ', function () {
|
|||||||
expect(actual.cssStyle).toBe('');
|
expect(actual.cssStyle).toBe('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle abstract classifier', function () {
|
it('should handle abstract method classifier', function () {
|
||||||
const str = 'foo()*';
|
const str = 'foo()*';
|
||||||
let actual = svgDraw.parseMember(str);
|
let actual = svgDraw.parseMember(str);
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ describe('class member Renderer, ', function () {
|
|||||||
expect(actual.cssStyle).toBe('font-style:italic;');
|
expect(actual.cssStyle).toBe('font-style:italic;');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle static classifier', function () {
|
it('should handle static method classifier', function () {
|
||||||
const str = 'foo()$';
|
const str = 'foo()$';
|
||||||
let actual = svgDraw.parseMember(str);
|
let actual = svgDraw.parseMember(str);
|
||||||
|
|
||||||
@@ -157,15 +157,7 @@ describe('class member Renderer, ', function () {
|
|||||||
expect(actual.cssStyle).toBe('');
|
expect(actual.cssStyle).toBe('');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should handle abstract classifier', function () {
|
it('should handle static field classifier', function () {
|
||||||
const str = 'String foo*';
|
|
||||||
let actual = svgDraw.parseMember(str);
|
|
||||||
|
|
||||||
expect(actual.displayText).toBe('String foo');
|
|
||||||
expect(actual.cssStyle).toBe('font-style:italic;');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should handle static classifier', function () {
|
|
||||||
const str = 'String foo$';
|
const str = 'String foo$';
|
||||||
let actual = svgDraw.parseMember(str);
|
let actual = svgDraw.parseMember(str);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user