Open GoogleCodeExporter opened 9 years ago
P.S: Specifying the class lang-htm/lang-html on the <pre class="prettyprint">
does not have any effect.
Expected behavior in this case: the entire style attribute should be
highlighted as "atv".
What I see instead: same as described in screen shot
prettify-unexpected-output.png
Original comment by schwarze...@hotmail.com
on 19 Mar 2011 at 10:02
Please try adding lang-css.js to the set of scripts you load to get CSS
language highlighting :
http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-css.j
s
Original comment by mikesamuel@gmail.com
on 21 Mar 2011 at 4:40
Loading lang-css.js but not specifying lang-css class on the <pre> works.
However, I still think that if there is no lang-css.js file loaded, prettify
should highlight the entire style attribute as "attribute value". See attached
file. I think the style attribute should have been formatted just like the
class attribute.
On the other hand, if prettify does this intentionally so that inline styles
could also be color coded, you can close this issue.
Original comment by schwarze...@hotmail.com
on 22 Mar 2011 at 6:05
Attachments:
Can you try adding
<script type="text/javascript"
src="http://google-code-prettify.googlecode.com/svn/trunk/src/lang-css.js"></scr
ipt>
after
<script type="text/javascript"
src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js"></scr
ipt>
and see if that addresses your problem. That is the language handler for CSS.
Original comment by mikesamuel@gmail.com
on 4 Apr 2011 at 5:44
Yes, loading lang-css.js color codes the HTML code as expected. Do read comment
#3.
Original comment by schwarze...@hotmail.com
on 5 Apr 2011 at 5:47
Ah, I must've glossed over comment 3. I'll look into ways to do what you
suggest. I'm not sure quite now how much it'll require increasing the download
size.
I think I also need to make it easy for people to automatically get lang-css.js
since an awful lot of people do want HTML highlighting.
Original comment by mikesamuel@gmail.com
on 5 Apr 2011 at 5:10
Thanks. I am not sure if this has something to do with download size. If
lang-css.js is not present, highlight the entire style attribute just like any
other attribute e.g. "class" and "id". If lang-css.js is loaded, continue with
current behavior.
Dreamweaver and Visual Studio 2008 highlight inline styles but rather naively.
This is how prettify behaves when lang-css.js is loaded but it does a far more
better job compared to these. Visual Studio prior to 2008 and Notepad++ on the
other hand highlight the entire style attribute in one color, this behavior I'd
expect from prettify if lang-css.js is not loaded.
I cannot say about others but I explicitly load lang-css.js when my HTML code
contains inline styles.
Original comment by schwarze...@hotmail.com
on 6 Apr 2011 at 6:03
Original issue reported on code.google.com by
schwarze...@hotmail.com
on 19 Mar 2011 at 9:45Attachments: