Comments (2)
Hello @SZaidAhmed ,
What I would do would be to use "${{" and "}}" for the delimiters.
This way you could use : "}" in your template without any issue.
from docxtemplater.
I will not add an option to ignore some kind of errors in the template, docxtemplater is quite strict, and by changing the delimiters, it will make it possible to use "}" in your template.
However, if a person writes : "Hello user}", then I want to warn users that the template is most probably invalid, I'm not going to add an option for it.
I don't want to add an obscure option to docxtemplater to handle this case.
If you really need this, you can fork docxtemplater and use following patch, it seems that it works for basic cases but I can't guarantee anything :
diff --git a/es6/lexer.js b/es6/lexer.js
index 44088bcf..a8714fe0 100644
--- a/es6/lexer.js
+++ b/es6/lexer.js
@@ -244,10 +244,13 @@ function getAllDelimiterIndexes(fullText, delimiters) {
case DELIMITER_NONE:
return indexes;
case DELIMITER_END:
- insideTag = false;
offset = endOffset;
position = "end";
len = end.length;
+ if (!insideTag) {
+ continue;
+ }
+ insideTag = false;
break;
case DELIMITER_START:
insideTag = true;
from docxtemplater.
Related Issues (20)
- Cannot resolve @Name placeholder HOT 2
- Chart Module: Unexpected Behavior with Null Value in Data HOT 3
- Differentiate between conditions and loops when getting tags HOT 1
- Conditional assignment doesn't work as expected HOT 1
- Page break propogates to all elements inside div HOT 5
- Numbering for conditional text HOT 3
- Question: Importing ExpressionParser in TypeScript. HOT 6
- When I write a tag in complex content, it doesn't work HOT 4
- HTMLModule Dependencies causing errors HOT 1
- paragraphLoop doesn't seem to work HOT 2
- ChartModule + ErrorLocationModule HOT 2
- Bun.sh HOT 1
- Trying to setup angular parser, but is failing with compilation error. HOT 8
- getSize 返回一个promsie ,word预览正常,但是导出word图片丢失 HOT 2
- Compile (tsx) issue with TxtTemplater HOT 1
- Ability to Insert IDs into XML Tags HOT 1
- Slides demo is broken HOT 1
- According to Microsoft Word, the generated file is corrupted. Cannot open it. HOT 12
- Duplicate content of a word file (in one page) HOT 1
- Error: New Delimiters cannot be parsed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docxtemplater.