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

Commit 8fbd564

Browse files
committed
fix!
1 parent 59ab934 commit 8fbd564

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/helpers/VaultManagement.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,15 @@ export async function updateRowFile(file: TFile, columnId: string, newValue: str
177177
* INLINE GROUP FUNCTIONS
178178
*******************************************************************************************/
179179
async function inlineColumnEdit(): Promise<void> {
180-
if (!Object.keys(rowFields.inline).contains(columnId)) {
180+
const inlineFieldRegex = new RegExp(`(^${columnId}[:]{2})+(.*$)`, 'gm');
181+
if (!inlineFieldRegex.test(content)) {
181182
await inlineAddColumn();
182183
return;
183184
}
184185
/* Regex explanation
185186
* group 1 is inline field checking that starts in new line
186187
* group 2 is the current value of inline field
187188
*/
188-
const inlineFieldRegex = new RegExp(`(^${columnId}[:]{2})+(.*$)`, 'gm');
189189
const noteObject = {
190190
action: 'replace',
191191
file: file,
@@ -216,15 +216,15 @@ export async function updateRowFile(file: TFile, columnId: string, newValue: str
216216
}
217217

218218
async function inlineAddColumn(): Promise<void> {
219-
const inlineAddRegex = new RegExp(`(^---\\s+[\\w\\W]+?\\s+---\\s)+(.[\\w\\W]+)`, 'g');
219+
const inlineAddRegex = new RegExp(`(^---[\\s\\S]+?---\\n)+(.*)`, 'g');
220220
const noteObject = {
221221
action: 'replace',
222222
file: file,
223223
regexp: inlineAddRegex,
224224
newValue: `$1${columnId}:: ${newValue}\n$2`
225225
};
226-
await VaultManagerDB.editNoteContent(noteObject);
227226
await persistFrontmatter();
227+
await VaultManagerDB.editNoteContent(noteObject);
228228
}
229229

230230
async function inlineRemoveColumn(): Promise<void> {

0 commit comments

Comments
 (0)