grunt-processhtml icon indicating copy to clipboard operation
grunt-processhtml copied to clipboard

Unexpected token <

Open jpcercal opened this issue 7 years ago • 1 comments

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 ${.

jpcercal avatar Feb 26 '18 15:02 jpcercal

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

dciccale avatar Mar 31 '18 10:03 dciccale