Skip to content

Commit 193bb28

Browse files
committed
fix #74 and #71
1 parent b83d7a2 commit 193bb28

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

exampleVault/examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Lorem ipsum dolor sit amet, `INPUT[date():other note#date]` consectetur adipisci
6565
- unknown tempalate
6666
- `INPUT[][toggle:toggle1]`
6767
- `INPUT[nonExistantTemplate][toggle:toggle1]`
68-
- `INPUT[toggleTemplate][:toggle1]`
68+
- `INPUT[toggleTemplate][]`
6969

7070
## Error Messages
7171
- `INPUT[text():meta bind/nonExistantFile#title]`

src/API.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ export class API {
3333
throw new MetaBindParsingError(`unknown render child type '${renderChildType}'`);
3434
}
3535
declaration = this.parser.parseDeclaration(declaration, undefined, templateName);
36-
return new InputFieldMarkdownRenderChild(container, renderChildType, declaration, this.plugin, filePath, crypto.randomUUID());
36+
return new InputFieldMarkdownRenderChild(container, renderChildType, declaration, this.plugin, filePath, self.crypto.randomUUID());
3737
}
3838

3939
public createInputFieldFromString(fullDeclaration: string, renderType: RenderChildType, filePath: string, container: HTMLElement): InputFieldMarkdownRenderChild {
4040
const declaration: InputFieldDeclaration = this.parser.parseString(fullDeclaration);
41-
return new InputFieldMarkdownRenderChild(container, renderType, declaration, this.plugin, filePath, crypto.randomUUID());
41+
return new InputFieldMarkdownRenderChild(container, renderType, declaration, this.plugin, filePath, self.crypto.randomUUID());
4242
}
4343

4444
public createDeclaration(inputFieldType: InputFieldType, inputFieldArguments?: { type: InputFieldArgumentType; value: string }[]): InputFieldDeclaration {

src/parsers/InputFieldDeclarationParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export class InputFieldDeclarationParser {
143143
}
144144

145145
// declaration parts
146-
const declarationParts: string[] = ParserUtils.split(inputFieldDeclaration.declaration, ':', this.squareBracesPair);
146+
const declarationParts: string[] = inputFieldDeclaration.declaration ? ParserUtils.split(inputFieldDeclaration.declaration, ':', this.squareBracesPair) : [''];
147147

148148
// bind target
149149
inputFieldDeclaration.bindTarget = declarationParts[1] ?? '';

src/utils/Signal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class Notifier<T, L extends Listener<T>> implements NotifierInterface<T,
1919

2020
public registerListener(listener: Omit<L, 'uuid'>): L {
2121
const l: L = listener as L;
22-
l.uuid = crypto.randomUUID();
22+
l.uuid = self.crypto.randomUUID();
2323

2424
this.listeners.push(l);
2525

0 commit comments

Comments
 (0)