Skip to content

Commit

Permalink
Update expressions-ie11 to show error if tag is not a string
Browse files Browse the repository at this point in the history
  • Loading branch information
edi9999 committed Dec 22, 2024
1 parent 2d01156 commit d5bee7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions es6/expressions-ie11.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ function getIdentifiers(x) {

function configuredParser(config = {}) {
return function expressionParser(tag) {
if (typeof tag !== "string") {
throw new Error(
"The angular parser was used incorrectly, please refer to the documentation of docxtemplater."
);
}
tag = tag.replace(/[]/g, "'").replace(/[]/g, '"');

while (dotRegex.test(tag)) {
Expand Down
2 changes: 1 addition & 1 deletion es6/expressions.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function configuredParser(config = {}) {
return function parser(tag) {
if (typeof tag !== "string") {
throw new Error(
"The angular parser was used incorrectly, please refer to the docxtemplater documentation."
"The angular parser was used incorrectly, please refer to the documentation of docxtemplater."
);
}
tag = tag.replace(/[]/g, "'").replace(/[]/g, '"');
Expand Down

0 comments on commit d5bee7a

Please sign in to comment.