Open ChaseTC opened 7 months ago
I've implemented a workaround for this issue by editing the frontmatterString
with a regex replace before adding it to the tR.
In the example regex bellow I'm using the variable age
from the example form you showed so it looks for the pattern age: "<somedigits>"
and then replaces it with age: <somedigits>
. Just edit so it uses the name of your form variable. Simple and effective.
<%*
const modalForm = app.plugins.plugins.modalforms.api;
const result = await modalForm.openForm('example-form');
let frontmatterString = result.asFrontmatterString().replace(/age:\s\"([0-9]*)\"/g, 'age: $1');
tR += frontmatterString;
-%>
Describe the bug When using
asFrontmatterString()
Number type fields are outputted as StringsTo Reproduce Steps to reproduce the bug:
Expected behavior
Number type fields should be outputted as numbers i.e.
age: 123