aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-06-14 14:50:43 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-06-14 14:50:43 -0400
commit391de70baf2f8744c617cd790b533fea584b9638 (patch)
tree4a2777402b314684f6d39fa0a34b4e314d67ec1f /src/client/views/collections/collectionSchema/SchemaTableCell.tsx
parentbd3170d3834c6ef9933813afc42f69df044d055b (diff)
func parser bug where multiple references to same doc didn't parse correctly fixed
Diffstat (limited to 'src/client/views/collections/collectionSchema/SchemaTableCell.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/SchemaTableCell.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
index 50ec2f978..26dc9c3c2 100644
--- a/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaTableCell.tsx
@@ -154,10 +154,10 @@ export class SchemaTableCell extends ObservableReactComponent<SchemaTableCellPro
const idPattern = /idToDoc\((.*?)\)/g;
let modField = field.slice();
let matches;
- let results = new Map<string, string>();
- while ((matches = idPattern.exec(field)) !== null) {results.set(matches[0], matches[1].replace(/"/g, '')); }
- results.forEach((id, funcId) => {modField = modField.replace(funcId, 'd' + (DocumentView.getDocViewIndex(IdToDoc(id))).toString());})
- if (!modField) modField = '';
+ let results = new Array<[id: string, func: string]>();
+ while ((matches = idPattern.exec(field)) !== null) {results.push([matches[0], matches[1].replace(/"/g, '')]); }
+ results.forEach((idFuncPair) => {modField = modField.replace(idFuncPair[0], 'd' + (DocumentView.getDocViewIndex(IdToDoc(idFuncPair[1]))).toString());})
+ if (modField.charAt(modField.length - 1) === ';') modField = modField.substring(0, modField.length - 1);
return modField;
}