hazand / google-code-prettify

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

Code in <Style>-Tags is not highlighted as XML when using lang-xml #280

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Steps to reproduce:
1. Style the code as XML (using lang-xml)
2. Use a <Style>-tag containing other XML code

Expected output:
The code inside the <Style> tag is rendered as XML

Current output:
The code inside the <Style> tag is rendered as CSS

See 
http://meta.stackoverflow.com/questions/71649/style-xml-element-in-code-block-me
sses-up-syntax-highlighting-coloring for details.

This behavior is desired when highlighting HTML, but not generally when 
highlighting XML code.

Original issue reported on code.google.com by markus.r...@googlemail.com on 17 Apr 2013 at 1:27

GoogleCodeExporter commented 9 years ago
The reason is that both HTML and XML are parsed using the same lexer:

http://code.google.com/p/google-code-prettify/source/browse/trunk/src/prettify.j
s#1294

which detects <style> and <script> tags inside the markup

Original comment by amroamro...@gmail.com on 22 May 2013 at 12:33