deayalas / google-code-prettify

Automatically exported from code.google.com/p/google-code-prettify
Apache License 2.0
0 stars 0 forks source link

Autodetection doesn't recognize commands #247

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
<pre class="prettyprint">
  dpkg -i mod-pagespeed-*.deb
  apt-get -f install
</pre>

Live: http://www.jefftk.com/test/google-code-prettify/#commands

Using lang-bsh fixes it.

Original issue reported on code.google.com by jefftk@google.com on 12 Sep 2012 at 7:59

Attachments:

GoogleCodeExporter commented 8 years ago
This is keyword detection in the default language gone awry since '-' is 
considered a token breaker in most languages.

Thanks for taking the time to write up 
http://www.jefftk.com/test/google-code-prettify/index#commands

Yeah, the default mode does a crap job with some shell-constructs.  The problem 
with '/' handling is that perl,JS,etc. use it for regexs and I've never come up 
with a good heuristic that fixes paths in shell languages without breaking JS 
in horrible ways.  It needn't be multiline except for perl obviously.

Since shell languages are so different, at a token level, from C style 
languages, they're likely to remain second class citizens.  Is specifying 
lang-sh or lang-bsh problematic?  If so, would it remain problematic if issue 
224 were implemented?

Original comment by mikesamuel@gmail.com on 4 Feb 2013 at 11:01