Incorrect syntax highlighting in an ASCII document


#1

Has anyone come up with a way to fix this?

System is win 7
Core packages
AsciiDoc Preview package
AsciiDoc Autocomplete Package
File Templates
Git-Plus package
AsciiDoc Language Package
Red Wavy Underline

Adding a second apostrophe somewhere does fix the problem but the area between first and second apostrophe is still broken red.

The actual document output is not affected, ie this is asciidoc format that’s processed into html5.

The asciidoc preview is also not affected.

Only editor panel is affected.

Doesn’t affect every apostrophe. Look further up in the image and you will see an apostrophe that’s not affected.

Autocomplete does not work in broken red areas.

Escaping apostrophe does not fix it.


Mass Red Highlight Issue
#2

It might help if you posted a screenshot that was a bit higher resolution. I can’t read anything in that image.


#3

Click the image and it will allow you to then expand it to full view at imgur by clicking the image again.

Edit: Or RMB->Open in new tab/window


#4

There are also times that code highlight fails when you use the link syntax.

Note that the link is greyed out completely after

link:https:

This is how it looks when it breaks. Once again it doesn’t do it on every link.

Edit: Changed image to show link broken when others are not.


#5

Mind sharing the document itself? I’d like to open it on my computer and see what it looks like.

You can also use the dev tools (ctrl-shift-i) to look at the CSS behind how the text is displayed. The classes applied to it may be educational.


#6

You can grab it off github or copy paste.

https://raw.githubusercontent.com/jMonkeyEngine/wiki/master/src/docs/asciidoc/jme3/advanced/jme3_ai.adoc

Edit: Breaks at line 743.


#7

For some reason (I don’t know why), the java scope is continuing past your code block. When I look at the classes around the red text, I see syntax--string syntax--quoted syntax--single syntax--java. When I delete the code block, the problem goes away.

I haven’t discovered why it’s bugging out with this code block and doesn’t do the same thing with the others.


#8

That’s what I saw when I looked using dev tools.

Your right that deleting that code block fixes it also.

I’m sort of surprised that you were able to duplicate the problem.


#9

It’s definitely something up with the syntax highlighting, which means that everyone with the same language package should be able to replicate it, but I stared at it for a while earlier and can’t see what’s different about that code block versus others. I haven’t taken the time yet to comb through the grammar.


#10

Hello.

The problem is most definitely from the piece of Java code. I switched off the language-Java package and the link was okay. Digging deeper…

The code piece currently looks like:

[source, java]
----
public class NavigationControl extends NavMeshPathfinder implements Control,
        JmeCloneable, Pickable {
----

Now see what happens to your link when you add the the last }.

[source, java]
----
public class NavigationControl extends NavMeshPathfinder implements Control,
        JmeCloneable, Pickable {}
----

The system does not close the Java code piece when you have the last ----. The Java code “stays open” until it sees the closing }.

This case you should take up with the package author.

Greetings.
- Dan

Edit: Before and after pictures…

CORRECTED COMMENT


#11

Very nice catch. That fixed everything.

Submitted a bug report with the package author.

Thanks again