liferay / electric

⚡ Create beautiful documentation for your projects
https://electricjs.com
Other
118 stars 26 forks source link

Inline code with /* breaks Soy compilation #150

Closed andreldm closed 6 years ago

andreldm commented 6 years ago

While a markdown page, if one tries to an inline code such as:

`check_sf **/*.jsp`

That will lead to this error:

Error: Error in plugin 'metal-tools-soy'
Message:
    Compile error:
errors during Soy compilation
In file .temp/task/metal/site/pages/tutorials/tips/code.soy: Unexpected fatal Soy error.  Please file a bug with your Soy file and we'll take a look.  Lexical error at line 84, column 0.  Encountered: <EOF> after : ""

^
    at Stream.handleError (/usr/local/lib/node_modules/electric-cli/node_modules/electric/lib/handle_error.js:9:9)
    at Stream.emit (events.js:187:15)
    at DestroyableTransform.onerror (/usr/local/lib/node_modules/electric-cli/node_modules/stream-combiner/index.js:36:18)
    at DestroyableTransform.emit (events.js:182:13)
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/electric-cli/node_modules/metal-tools-soy/lib/pipelines/compileSoy.js:216:11)
    at ChildProcess.emit (events.js:182:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)

I think the problem is caused by /*being interpret as comment start. Interestingly, this error is not caused when using blocks of code (three back-ticks).

zenorocha commented 6 years ago

Try using {literal}

https://github.com/liferay/soy-cheat-sheet/#special-characters

andreldm commented 6 years ago

Yeah, it works, the markdown is parsed correctly. Thanks!