Skip to content

Commit

Permalink
fix: handling annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
knsv committed Jan 18, 2022
1 parent 44d7dfe commit 2210c73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/dagre-wrapper/createLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function addHtmlLabel(node) {
}

const createLabel = (_vertexText, style, isTitle, isNode) => {
let vertexText = sanitizeTxt(_vertexText || '');
let vertexText = _vertexText || '';
if (typeof vertexText === 'object') vertexText = vertexText[0];
if (evaluate(getConfig().flowchart.htmlLabels)) {
// TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that?
Expand Down
7 changes: 3 additions & 4 deletions src/diagrams/class/classDb.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,15 @@ export const addMember = function (className, member) {

if (typeof member === 'string') {
// Member can contain white spaces, we trim them out
// const memberString = sanitizeText(member.trim());
const memberString = member.trim();

if (memberString.startsWith('<<') && memberString.endsWith('>>')) {
// Remove leading and trailing brackets
theClass.annotations.push(memberString.substring(2, memberString.length - 2));
theClass.annotations.push(sanitizeText(memberString.substring(2, memberString.length - 2)));
} else if (memberString.indexOf(')') > 0) {
theClass.methods.push(memberString);
theClass.methods.push(sanitizeText(memberString));
} else if (memberString) {
theClass.members.push(memberString);
theClass.members.push(sanitizeText(memberString));
}
}
};
Expand Down

0 comments on commit 2210c73

Please sign in to comment.