Closed koosvanderkolk closed 5 months ago
I don't think it is wise to implement this in docx-templates, as that would add yet another layer of configuration and complexity.
You can probably do 90% of what you want by using a custom runJs
function. See e.g. https://github.com/guigrpa/docx-templates/blob/5ad3cfd40866961a99a3772b07ad1cdea8b9b23c/examples/example-vm2/index.js#L40
My use case is that I would like to let 'less technical' end-users create their own templates.
E.g. let them create
Which should then be converted to:
I also have quite some variables which contain HTML. For those, I want the end-user to just add
Which should then be converted to
So the feature request would be to have a preprocess function, in which I can alter the template before it is being interpreted.