antonmihaylov / OpenXmlTemplates

Word .docx templating system that is designer (no scripting tags) and server-friendly (no word installation required)
GNU Lesser General Public License v3.0
92 stars 25 forks source link

Placeholder not completely replaced #7

Closed itsamaik closed 4 years ago

itsamaik commented 4 years ago

If you set a placeholder in your control with a text length longer than the value that is going to replace it, it will only replace the length of the given value. For example, if the placeholder text is "abcdefgh" and you replace it with "Test", you will get "Testefgh"

antonmihaylov commented 4 years ago

I couldn't replicate that, can you give me an example (doc file and data file)

itsamaik commented 4 years ago

I've managed to replicate it with this document: debug.docx

I've used the following data: new { test = "abc", show = true, }

Resulting in this document: debug_output.docx

I am still not completely sure when it happens. When I cleared out my document and left one control it worked. However, then I created a completely new document and added the control + a table and some controls and it resulted into this. When I remove the table, the issue still occurs, so I don't think the table has any influence.