mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-14 01:34:19 +01:00
Merge branch 'develop' into feature/class-namespace
This commit is contained in:
@@ -117,6 +117,7 @@ export const clear = function () {
|
||||
export const getClass = function (id: string) {
|
||||
return classes[id];
|
||||
};
|
||||
|
||||
export const getClasses = function () {
|
||||
return classes;
|
||||
};
|
||||
@@ -181,9 +182,10 @@ export const addMember = function (className: string, member: string) {
|
||||
const memberString = member.trim();
|
||||
|
||||
if (memberString.startsWith('<<') && memberString.endsWith('>>')) {
|
||||
// Remove leading and trailing brackets
|
||||
// its an annotation
|
||||
theClass.annotations.push(sanitizeText(memberString.substring(2, memberString.length - 2)));
|
||||
} else if (memberString.indexOf(')') > 0) {
|
||||
//its a method
|
||||
theClass.methods.push(sanitizeText(memberString));
|
||||
} else if (memberString) {
|
||||
theClass.members.push(sanitizeText(memberString));
|
||||
@@ -245,6 +247,7 @@ const setTooltip = function (ids: string, tooltip?: string) {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const getTooltip = function (id: string, namespace?: string) {
|
||||
if (namespace) {
|
||||
return namespaces[namespace].classes[id].tooltip;
|
||||
|
||||
Reference in New Issue
Block a user