dosper7 / google-code-prettify

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

prettyPrintOne is broken by r102 and r95 #133

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Execute prettyPrintOne('select * from table', 'sql'):

<html>
<body>
<script language="javascript" src="prettify.js"></script>
<script language="javascript">
  document.write(prettyPrintOne('select * from table', 'sql'));
</script>
</body>
</html>

What is the expected output? 
The passed html string should be colored, no exception should occur

What do you see instead?
TypeError: Cannot read property 'className' of undefined
    at recombineTagsAndDecorations (prettify.js:1108:37)
    at applyDecorator (prettify.js:1361:7)
    at prettyPrintOne (prettify.js:1374:5)
    at html.html:5:18

What version are you using? On what browser?
21-Jul-2010, Chrome 7.0.536.2

Please provide any additional information below.
I guess, recombineTagsAndDecorations should not mention "sourceNode" directly 
since there is no such thing as sourceNode when you are just coloring a string.

Original issue reported on code.google.com by sitnikov...@gmail.com on 3 Oct 2010 at 7:05

GoogleCodeExporter commented 8 years ago
Fixed at r120 : 
http://code.google.com/p/google-code-prettify/source/detail?r=120

Original comment by mikesamuel@gmail.com on 16 Nov 2010 at 6:01