-
Notifications
You must be signed in to change notification settings - Fork 31
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
Groovy import statement renders with red spaces on GitHub #17
Comments
OK, some of these are very simple issues. The import rule is too strict about not allowing trailing whitespace and comments. But splitting the import rule into two lines and the trailing (And yes you are correct about the file used for the highlighting, it is a set of nested regular expression rules that match the various parts of the document.) |
The only part of this Issue that matters is being able to place a comment after an import without needing a semicolon to make it legal. After I looked in the language file and found that it had begin/end patterns, it occurred to me that forcing the formatter to use those patterns by splitting lines might provide additional clues. But the compiler says that splitting an import line is not legal, so the only issue around that for the formatter is what it complains about. The issue should be the line feed, not the spaces or dots on the second of the two lines. I have looked for a Groovy language specification in the past, without success. |
On top of that, |
@infininight unfortunately it seems there is no formal language spec for Groovy, which is a bit annoying because there are some frequently-used features like quoted function names that aren't clearly documented (see #11 and Spock Framework examples). I have found the following pages, which help a bit, though:
On the Style Guide page they describe "no semicolons" and "import aliasing", both of which are relevant to this ticket. Is there any chance we can get some of the open PRs or forks that are running a bit ahead of this one merged here? This is the project GitHub is using as its syntax highlighter, so it would be nice to fix any smaller issues. |
See this repository for an example.
This shows an import statement with a following callout.
Any space between the end of the import statement is rendered as a red block.
Adding a semicolon at the end of the import statement works around the problem.
The HTML generated by Asciidoctor on my own installation is:
The HTML generated on GitHub for the line is
The problem seems to be this:
The
pl-ii
is a GitHub light CSS style:So the syntax in my example is considered incorrect.
I added some other formatting possibilities to my example as well.
For example, splitting the import across two statements.
These examples show that the problem happens with a trailing comment on an import line.
One of them suggests that splitting an import over two lines is not well handled either.
I guessed that this file was probably used to do the formatting, and some patterns that look like they would match do include some formatting for illegal characters.
But I wasn't able to pin down exactly what was going wrong.
The text was updated successfully, but these errors were encountered: