-
Notifications
You must be signed in to change notification settings - Fork 12
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
rst code directive must be followed by empty line #28
Comments
I'm looking into this now, and have some idea about the problem, but wanted to raise a related issue. It seems like I think the underlying problem still exists, but something else is is also happening with syntax regions being overridden by other more general ones. This may be due to some reordering of definitions which was done to fix other problems. |
Been looking further into this. The problem could be solved by extending the
to something like this
There's probably some way to streamline that, it's probably got some redundancy in it. This would be an improvement, but it would be need to be manually added to all of the region definitions. It would be great to consolidate them into a more general definition that is in one place. I have noticed that inconsistency between the various region definitions have started to appear. Either way, before moving forward on this, I'm testing out some alternative approaches that look for space prior to the |
The following seems to fix a lot of the problems that have been around for a while. (For literal blocks, but should be applicable to code blocks).
It grabs the whitespace prior to the first line and then uses it to check for a line with this space or less (not The only problem (so far) is that inline highlights, like Emphasis, seem to disable it. For example, this only highlights the emphasis and disables the literal block:
This may actually not be a problem for code blocks and other directives, since they do not have inline literals. Anyway just writing down my thoughts before I forget them. |
I've made a change that appears to fix a wide host of problems with literal blocks:
The main change is using Along with this, it appears to fix the line issue by requiring As far as I can see, it seems to fix every issue that I can find. I think this technique can be applied to code blocks and other directives. Edit: Of course I naturally forgot to say that this is thanks to user Rich at the Vi Stack Exchange: |
thanks for figuring this out :) |
is valid rst but
is not (as checked per rst2html, as well as the spec: http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#directives "If either arguments and/or options are employed by the directive, a blank line must separate them from the directive content.")
But vim-restructuredtext highlights both blocks in the same manner. It would be mildly helpful if e.g. there was no highlighting in the second case (hinting that something is incorrect).
The text was updated successfully, but these errors were encountered: