isagalaev/highlight.js — Issue #47: Multiline code is not handled correctly
Author: wdacgrs
Created: 2012-03-06 08:38:08+00:00
State: open

Recently, we have been trying to use highlight.js on VBA code, which we believe has the same syntax as VBScript. We use 'vbscript' as the identifier for specifying the language. Everything works very well except for one part: the handling of multiple line code.

Here is an example fragment which fails at the end:

``` vb
Dim mary As Person, george As Person, mimi As Person

Set mary = New Person

mary.initialize('Mary White', '1960/11/28', 50000, 'Very kind ' & _
'and loving, she loves cooking and taking care of the house')

```
This VBA code works fine in the real world. The '_' is used to split code across two or more lines. However, the last parenthesis ')' of the last line of code is recognised by highlight.js as being part of the string. It is not recognised as being part of the parenthesis expression started on the previous line.

Actually we went through the development guide hoping to create a new language specification for VBA but failed to figure out how to handle the '_' situation, like the one in the above code example.

It would be extremely helpful if you could tell us whether it is possible to do what we want to do.

Thank you very much for your kind attention and help!