Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit f3863f1

Browse files
committed
fix double wrap on config with some cases
1 parent 66a36e9 commit f3863f1

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/parsers/handlers/unmarshall/UnmarshallConfigHandler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ export class UnmarshallConfigHandler extends AbstractDiskHandler {
1717
this.localDisk.push(`${YAML_INDENT.repeat(1)}${key}:`);
1818
Object.entries(valueConfig).forEach(([key, valueInternal]) => {
1919
// Lvl3: config properties
20-
this.localDisk.push(`${YAML_INDENT.repeat(2)}${key}: "${parseValue(valueInternal as string, config)}"`);
20+
this.localDisk.push(`${YAML_INDENT.repeat(2)}${key}: ${parseValue(valueInternal as string, config)}`);
2121
});
2222
} else if (typeof valueConfig == "string") {
23-
this.localDisk.push(`${YAML_INDENT.repeat(1)}${key}: "${parseValue(escapeSpecialCharacters(valueConfig), config)}"`);
23+
this.localDisk.push(`${YAML_INDENT.repeat(1)}${key}: ${parseValue(escapeSpecialCharacters(valueConfig), config)}`);
2424
} else {
2525
// Lvl2: config properties
26-
this.localDisk.push(`${YAML_INDENT.repeat(1)}${key}: "${parseValue(valueConfig, config)}"`);
26+
this.localDisk.push(`${YAML_INDENT.repeat(1)}${key}: ${parseValue(valueConfig, config)}`);
2727
}
2828
});
2929
return this.goNext(handlerResponse);

src/services/DataviewService.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,16 @@ class DataviewProxy {
223223
}
224224

225225
private handleMarkdownBreaker(value: string, localSettings: LocalSettings, isInline?: boolean): string {
226-
if (isInline || (value.startsWith('"') && value.endsWith('"'))) {
226+
// Do nothing if is inline
227+
if (isInline) {
227228
return value;
228229
}
230+
231+
// Remove a possible already existing quote wrapper
232+
if (value.startsWith('"') && value.endsWith('"')) {
233+
value = value.substring(1, value.length - 1);
234+
}
235+
229236
// Check possible markdown breakers of the yaml
230237
if (MarkdownBreakerRules.INIT_CHARS.some(c => value.startsWith(c)) ||
231238
MarkdownBreakerRules.BETWEEN_CHARS.some(rule => value.includes(rule)) ||

0 commit comments

Comments
 (0)