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

Commit d821986

Browse files
committed
Merge branch 'hotfix-1.1.1'
2 parents 1c575e6 + 42347c6 commit d821986

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/helpers/VaultManagement.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export async function updateRowFile(file: TFile, columnId: string, newValue: str
9696
const content = await VaultManagerDB.obtainContentFromTfile(file);
9797
let currentFrontmatter = VaultManagerDB.ontainCurrentFrontmatter(content);
9898
const column = state.columns.find(c => c.key === columnId);
99-
99+
console.log("pruebas");
100100
// Adds an empty frontmatter at the beginning of the file
101101
async function addFrontmatter(): Promise<void> {
102102
/* Regex explanation
@@ -156,12 +156,12 @@ export async function updateRowFile(file: TFile, columnId: string, newValue: str
156156
}
157157

158158
async function persistFrontmatter(deletedColumn?: string): Promise<void> {
159-
const frontmatterGroupRegex = new RegExp(`^---\\s+([\\w\\W]+?)\\s+---`, "g");
159+
const frontmatterGroupRegex = new RegExp(`(^---\\n)+(.*)+(^---)`, "gm");
160160
const noteObject = {
161161
action: 'replace',
162162
file: file,
163163
regexp: frontmatterGroupRegex,
164-
newValue: parseFrontmatterFieldsToString(rowFields, currentFrontmatter, deletedColumn)
164+
newValue: `${parseFrontmatterFieldsToString(rowFields, currentFrontmatter, deletedColumn)}`
165165
};
166166
await VaultManagerDB.editNoteContent(noteObject);
167167
}

src/services/DataviewService.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ class DataviewProxy {
6363
parseLiteral(literal: Literal, dataTypeDst: string): Literal {
6464
let parsedLiteral: Literal = literal;
6565
const wrapped = this.getDataviewAPI().value.wrapValue(literal)
66+
if (wrapped.value === undefined || wrapped.value === null) {
67+
return "";
68+
}
6669
// Check empty or undefined literals
6770
switch (dataTypeDst) {
6871
case DataTypes.CALENDAR:

0 commit comments

Comments
 (0)