Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacement of data is not working in template based example #10

Open
hamidabdul1994 opened this issue Sep 27, 2022 · 2 comments
Open

Comments

@hamidabdul1994
Copy link

Sometimes Variables are replaced properly but sometimes it is giving issues after rendering/parsing in the library.

My Template
image

Result after Parsing
image

Code base which is converting template to final docx
`
// Method to process docx data and generate document
func (d *Docx) Process(data interface{}) error {

template, err := docxt.OpenTemplate(d.source)
if err != nil {
	logger.Error("Error while processing Template ,", err)
	return err
}
if err := template.RenderTemplate(data); err != nil {
	logger.Error("Error while Rendering Template ,", err)
	return err
}
if err := template.Save(d.destination); err != nil {
	logger.Error("Error while saving Template ,", err)
	return err
}
logger.Info("Successfully Processed")
return nil

} `

@coderisimo
Copy link

the same situation ((

@AndyGreenwell94
Copy link

AndyGreenwell94 commented Apr 14, 2024

The issue is spell check. Word appends original XML with additional tags (to display spell check error) right between {{ and }}. Disabling spellcheck for those lines would help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants