Skip to content

Commit

Permalink
Merge pull request #41 from mitre/fix/pipe_chars
Browse files Browse the repository at this point in the history
Fix/pipe chars
  • Loading branch information
elegantmoose authored Feb 20, 2024
2 parents 99f0056 + bc554a2 commit aa1061d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/operations/AddPotentialLinkModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ const potentialLinksToAdd = computed(() => {
let combinations = [];
Object.keys(selectedPotentialLinkFacts.value).forEach((factName, i) => {
combinations.push(selectedPotentialLinkFacts.value[factName].facts.filter((fact) => fact.selected).map((fact) => `${factName}|${fact.value}`));
combinations.push(selectedPotentialLinkFacts.value[factName].facts.filter((fact) => fact.selected).map((fact) => `${factName.length}|${factName}${fact.value}`));
if (selectedPotentialLinkFacts.value[factName].customValue) {
combinations[i].push(`${factName}|${selectedPotentialLinkFacts.value[factName].customValue}`);
combinations[i].push(`${factName.length}|${factName}${selectedPotentialLinkFacts.value[factName].customValue}`);
}
});
combinations = cartesian(combinations);
Expand All @@ -89,8 +89,8 @@ const potentialLinksToAdd = computed(() => {
combinations.forEach((factGroup) => {
let command = potentialLinkCommand.value;
factGroup.forEach((fact) => {
let split = fact.split('|');
command = command.replaceAll(`#{${split[0]}}`, split[1])
let factNameLength = fact.split('|', 1)[0], restOfFact = fact.slice(1+factNameLength.length);
command = command.replaceAll(`#{${restOfFact.slice(0, parseInt(factNameLength))}}`, restOfFact.slice(parseInt(factNameLength)));
});
links.push({
Expand Down

0 comments on commit aa1061d

Please sign in to comment.