Skip to main content
3 of 4
update note
Jankapunkt
  • 8.4k
  • 12
  • 10

Why is bash script not highlighted by google prettify

Note: I could not distinct if this is a bug due to wrong inclusion of prettify, prettify itself or wrong usage by me, since it is not explicitly documented on prettify, how to properly format bash scripts. There is only an indirect reference on supported languages, indicating using lang-bsh. Using lang-sh does not work either.

Update: I added also the lang tags lang-bash and lang-sh, which do not work either.

I have a code of two bash outputs mixed with one other code (e.g. javascript)

Formatting the following way does not highlight the bash scripts as expected:

<!-- language: lang-bsh -->
$ npm install --save tarball-output.tgz

<!-- language: lang-js -->
let someFunc = function(){ return "proper format" }

<!-- language: lang-sh -->
ERROR: (gcloud.beta.functions.deploy) OperationError: code=3,
message=Function load error: Code in file app.js can't be loaded. 
Did you list all required modules in the package.json dependencies? 
Detailed stack trace: Error: Cannot find module 'my_package'

<!-- language: lang-bash -->
W20170704-12:19:27.778(2)? (STDERR) MochaRunner.runServerTests: failures: 7

Returns the following formatted codes:

$ npm install --save tarball-output.tgz
let someFunc = function(){ return "proper format" }
ERROR: (gcloud.beta.functions.deploy) OperationError: code=3,
message=Function load error: Code in file app.js can't be loaded. 
Did you list all required modules in the package.json dependencies? 
Detailed stack trace: Error: Cannot find module 'my_package'
W20170704-12:19:27.778(2)? (STDERR) MochaRunner.runServerTests: failures: 7

As you can see, the bash script formattings are ignored and (somehow) receive the formatting of the javascript syntax. Is this a bug on SO/prettify or am I doing it wrong?

Jankapunkt
  • 8.4k
  • 12
  • 10