sunshengfei / google-code-prettify

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

VB Comments Not Working #68

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I commented on issue 27 saying the problem is still occuring, but I'm
opening a new issue to track it separately. 

I'm running rev 64 of all files and comments in VB/VB.NET aren't
highlighting correctly. 

A comment that starts with ' and ends with a new line continues to
highlight until the next '. It's not honoring the new line as the end of
the comment. 

I've attached a test file. You can also see it in action here:
http://www.dreamincode.net/forums/index.php?showtopic=87819&hl=

Original issue reported on code.google.com by skyhawk...@gmail.com on 20 Feb 2009 at 6:41

Attachments:

GoogleCodeExporter commented 8 years ago
In test file change <pre class="codemain lang-vb"> to <pre class="prettyprint
lang-vb"> to work with stock rev 64 of prettify.js

Original comment by skyhawk...@gmail.com on 20 Feb 2009 at 6:43

GoogleCodeExporter commented 8 years ago
I've an example with <pre class="prettyprint lang-vb"> at

http://officeadd.in/vba_and_excel/vba_code_test.aspx

To make the single line comments work i've had to use ''# (the first single 
quote so
VB parses it correctly and the following '# so that Prettify shows the comments)

Original comment by mark.nold on 30 Mar 2009 at 12:28

GoogleCodeExporter commented 8 years ago

Original comment by mikesamuel@gmail.com on 19 May 2009 at 5:27

GoogleCodeExporter commented 8 years ago
Thanks for the great example.
I can't repeat the problem.  Can you make sure your example is loading 
lang-vb.js?

Original comment by mikesamuel@gmail.com on 19 May 2009 at 4:45

GoogleCodeExporter commented 8 years ago
It's still doing it on this thread:
http://www.dreamincode.net/forums/index.php?showtopic=87819&hl=

Notice the first comment in the [code] block. It continues past the comment and
includes Sub Main() in grey/comment coloring. 

It's using <pre class='codemain lang-vb'> and I have lang-vb uploaded and it 
should
be calling it however I can't tell for sure. 

Original comment by skyhawk...@gmail.com on 19 May 2009 at 4:49

GoogleCodeExporter commented 8 years ago

Mike i'm sorry, this was user error. I'll document here for others with the 
same problem.

The page http://officeadd.in/code/prettify_js_-_syntax_highlighting.aspx now 
works
properly and the first "VBA Example" which failed, now works.

To get vb syntax highlighting working correctly you need three things;

<script type="text/javascript" 
src="/External/css/prettify/prettify.js"></script>
<script type="text/javascript" src="/External/css/prettify/lang-vb.js"></script>

and a PRE block around your code eg:

<PRE class="prettyprint lang-vb">
 Function SomeVB() as string
   ' do stuff
 End Function
</PRE>

If you are experiencing problems with prettify and VB comments it's probably 
because
you haven't loaded lang-vb.js in addition to prettify.js

Thanks Mike, excellent work. I'll update my page with these details. 

PS: Skyhawk, i've checked your page and you are missing lang-vb.js as well.

Original comment by mark.nold on 20 May 2009 at 1:29

GoogleCodeExporter commented 8 years ago
I'm glad it works for you now.  Will close this bug.  Please open a new bug if 
you
have further problems.

Original comment by mikesamuel@gmail.com on 20 May 2009 at 2:45