Skip to content

Commit

Permalink
fix: trim step name before checking for its dfs index
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulTheActivePiecer committed Nov 28, 2024
1 parent 93cf28e commit 33d593f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ enum TipTapNodeTypes {
const isMentionNodeText = (item: string) => /^\{\{.*\}\}$/.test(item);
const isStepName = (stepName:string)=>{
const pattern = /^(step_\d+|trigger)/;
return pattern.test(stepName);
return pattern.test(stepName.trim());

}
type ParseMentionNodeFromText = {
Expand Down Expand Up @@ -88,7 +88,7 @@ const getStepMetadataFromPath = (
stepsMetadata: (StepMetadataWithDisplayName | undefined)[],
) => {
const stepPath = removeIntroplationBrackets(path);
const stepName = textMentionUtils.keysWithinPath(stepPath)[0];
const stepName = textMentionUtils.keysWithinPath(stepPath)[0].trim();
const index = steps.findIndex((step) => step.name === stepName);
return {
dfsIndex: index,
Expand Down

0 comments on commit 33d593f

Please sign in to comment.