Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of [ ] inside java string produces incorrect output #45

Closed
GoogleCodeExporter opened this issue Apr 19, 2016 · 3 comments
Closed

Use of [ ] inside java string produces incorrect output #45

GoogleCodeExporter opened this issue Apr 19, 2016 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Use html like the following:
<pre class="prettyprint">
  throw new RuntimeException("Element [" + element.getName() + 
    "] missing attribute.");
  variable++;
</pre>

What is the expected output?  What do you see instead?
1. Expect that 'variable ++;' line is colored as code, but it is instead
displayed as a comment. The last double-quote character on the preceding
line is printed 'fancy', and all following characters on this same line are
 also colored as comment (colored as code would be expected).

What version are you using?  On what browser?
31-Aug-2007 (small) on Firefox 2.0.0.14. Same problem occurs on Internet
Explorer 7.


Original issue reported on code.google.com by basil.va...@gmail.com on 1 Jul 2008 at 10:30

@GoogleCodeExporter
Copy link
Author

I can't repeat this problem on either Firefox 2.0.0.14 or IE 6.
I get the attached.  Do the testcases run correctly on your setup?

Original comment by mikesamuel@gmail.com on 5 Jul 2008 at 10:11

Attachments:

@GoogleCodeExporter
Copy link
Author

Thanks for the fast response.
Yes, the test case runs correctly for me.

I've looked into this further, and it appears the problem is on my end. I'm 
using
WordPress to publish content on my site, and WordPress is converting a trailing
double-quote into a ” character, which is similar but not identical, so code
prettifier correctly thinks the string is not terminated and continues the 
coloring
onto the next line.

This <a href="http://wordpress.org/support/topic/125038">WordPress support
article</a> describes how to prevent WordPress from doing this conversion. 

So in conclusion there is no defect in Code Prettify.

Original comment by basil.va...@gmail.com on 5 Jul 2008 at 10:51

@GoogleCodeExporter
Copy link
Author

Glad you found the problem.

I will add that article to the FAQ.

Happy prettyprinting.

Original comment by mikesamuel@gmail.com on 5 Jul 2008 at 11:54

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant