Skip to content

Commit

Permalink
fixed all rendering differences
Browse files Browse the repository at this point in the history
  • Loading branch information
Austin Fulbright authored and Austin Fulbright committed Jul 27, 2024
1 parent 9f6a7b7 commit 275dbe9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/mermaid/src/diagrams/git/gitGraphAst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ export const cherryPick = function (
targetId = common.sanitizeText(targetId, getConfig());
const config = getConfig();
tags = tags?.map((tag) => common.sanitizeText(tag, config));

parentCommitId = common.sanitizeText(parentCommitId, getConfig());

if (!sourceId || !state.records.commits.has(sourceId)) {
Expand Down Expand Up @@ -383,6 +384,7 @@ export const cherryPick = function (
}`,
],
};

state.records.head = commit;
state.records.commits.set(commit.id, commit);
state.records.branches.set(state.records.currBranch, commit.id);
Expand Down
2 changes: 1 addition & 1 deletion packages/mermaid/src/diagrams/git/gitGraphParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const parseCheckout = (checkout: CheckoutAst) => {

const parseCherryPicking = (cherryPicking: CherryPickingAst) => {
const id = cherryPicking.id;
const tags = cherryPicking.tags ?? undefined;
const tags = cherryPicking.tags?.length === 0 ? undefined : cherryPicking.tags;
const parent = cherryPicking.parent;
db.cherryPick(id, '', tags, parent);
};
Expand Down
4 changes: 2 additions & 2 deletions packages/parser/src/language/gitGraph/gitGraph.langium
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Merge:
(
'id:' id=STRING
|'tag:' tags+=STRING
|'type:' name=('NORMAL' | 'REVERSE' | 'HIGHLIGHT')
|'type:' type=('NORMAL' | 'REVERSE' | 'HIGHLIGHT')
)* EOL;

Checkout:
Expand All @@ -76,7 +76,7 @@ CherryPicking:
(
'id:' id=STRING
|'tag:' tags+=STRING
|'parent:' id=STRING
|'parent:' parent=STRING
)* EOL;


Expand Down

0 comments on commit 275dbe9

Please sign in to comment.