Skip to content

Commit

Permalink
Added note to README on browser compatibility of in-template JS code
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhbw committed May 5, 2020
1 parent 41f2d39 commit eb0c8cf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -141,6 +141,9 @@ createReport({

Check out the examples [using Webpack](https://github.com/guigrpa/docx-templates/tree/master/packages/example-webpack) and [using Browserify](https://github.com/guigrpa/docx-templates/tree/master/packages/example-browserify).

### Browser compatibility caveat
Note that the JavaScript code in your docx template will be run as-is by the browser. Transpilers like Babel can't see this code, and won't be able to polyfill it. This means that the JS code in your template needs to be compatible with the browsers you are targeting. In other words: don't use fancy modern syntax and functions in your template if you want older browsers, like IE11, to be able to render it.

## Custom command delimiters
You can use different **left/right command delimiters** by passing an array to `cmdDelimiter`:

Expand Down

0 comments on commit eb0c8cf

Please sign in to comment.