dciccale / grunt-processhtml

Process html files at build time to modify them depending on the release environment
MIT License
407 stars 30 forks source link

Unexpected token < #115

Open jpcercal opened 6 years ago

jpcercal commented 6 years ago

I can't process my HTML that contains this snippet.

for s in "${precmd_functions[@]}"; do
  if [ "$s" = "powerline_precmd" ]; then
    return
  fi
done

The error message and the stack:

Fatal error: Unexpected token <
SyntaxError: Unexpected token <
    at Function (<anonymous>)
    at HTMLProcessor.template (/usr/share/blog/node_modules/htmlprocessor/node_modules/lodash/dist/lodash.js:6307:22)
    at /usr/share/blog/node_modules/grunt-processhtml/tasks/processhtml.js:59:26
    at /usr/share/blog/node_modules/grunt-processhtml/node_modules/async/lib/async.js:769:13
    at iterate (/usr/share/blog/node_modules/grunt-processhtml/node_modules/async/lib/async.js:262:13)
    at async.forEachOfSeries.async.eachOfSeries (/usr/share/blog/node_modules/grunt-processhtml/node_modules/async/lib/async.js:281:9)
    at _concat (/usr/share/blog/node_modules/grunt-processhtml/node_modules/async/lib/async.js:768:9)
    at Object.concatSeries (/usr/share/blog/node_modules/grunt-processhtml/node_modules/async/lib/async.js:347:20)
    at /usr/share/blog/node_modules/grunt-processhtml/tasks/processhtml.js:54:13
    at /usr/share/blog/node_modules/grunt-processhtml/node_modules/async/lib/async.js:181:20

I suspect that this problem is because of this string ${.

dciccale commented 6 years ago

Hi, could you provide an example I can run and see the failure?