Open peterbe opened 10 years ago
I think this is because that <style>
element is never closed with a </style>
and so it is still assuming it is parsing over CSS when it hits the ```
Also breaks when I put in ` (literal backtick, outside of a code block)
I've hit the same issue, with a JSON blob:
The JSON is not valid (due to the ...
), but everything else looks like angry text.
Similar issue, this time with not being able to handle long code fences for displaying markdown code.
@alanguir I just fixed your issue in https://github.com/atom/language-gfm/commit/c3a70e3b1295e0c51d83a9f970e4d024338b89cb
It should now parse code blocks inside of code blocks correctly
This will be included in the next Atom release, 0.136
@kevinsawicki Awesome, thanks for picking that up so quickly
@kevinsawicki what library was being used for that originally? It looks like even gists showed that same parsing behavior of not catching nested code blocks
what library was being used for that originally? It looks like even gists showed that same parsing behavior of not catching nested code blocks
I think Gist uses a derivative of https://github.com/vmg/sundown with additions using https://github.com/jch/html-pipeline
Got the same issue in atom v1.0.7.
A newline between > text here
and '''
highlights the remaining text correctly.
C++ syntax highlighting fails after
like those Render Success:
struct Foo{
void* p;
};
Render failed:
struct Foo{
void *p;
};
Atom 1.0.19 on Ubuntu 15.04
@fcharlie that is a different bug. Please see #44.
Similar issue here:
Same problem here in Atom 1.14.4 Hints?
For now you have to completely close all your code snippets (in your case, make sure that they are valid Java).
@50Wliu In my opinion that can't be valid if this is a snippet. The point of a snippet is to highlight part of a larger code base.
@50Wliu Another point, languages evolves. For example I have a valid Java code, but Atom does not recognise the valid syntax in the snippet, and as such it is not correctly closed.
In this code, the java language doesn't understand the try with resources (yet it's pretty old).
Yeah, I completely understand. The problem is at this point we have no way to force-close the code snippet.
(Also, try-with-resources support requires more work than it looks like)
@50Wliu Yes this problem seems to be related to this issue https://github.com/atom/language-java/issues/88. Thanks for feedback by the way !
In my opinion issues in the sub language plugin should not affect the gfm plugin. I am not a maintainer of this project so I dont know how hard it would be to do that.
BTW, I located the source of the bug in atom/first-mate#83 (missing feature, actually).
Looks like this bug hasn't been updated in a while. I'm running into this issue using Atom 1.40.1 on Linux. I've got this set of Markdown files that I'm using with Slate for some API documentation, and each of them has fenced code blocks for both Python and Javascript code examples. I noticed that in one of my files, the editor lost all the syntax highlighting after the first 2 code blocks, which is pretty annoying because it makes errors harder to spot.
Any idea when this might get fixed?
Not sure, but I've been keeping close tabs on this personally as someone heavily affected by it. To my understanding, Atom is migrating from a TextMate variant to Tree Sitter, which solves it by design by basically scoping all grammars by default. There doesn't appear to be a timeline for this AFAICT, but IIUC, language-gfm can't be migrated to Tree Sitter until all its child grammars have Tree Sitter variants.
You could probably glean an idea how much progress has been made based on how many of the child Markdown grammars have been converted.
I've been hitting various problems of this type for years now.
How's that for an idea: Add an option in the plugin Settings to disable syntax highlighting for code snippets? This will take care of any bugs found in other Atom syntax libraries like Java. (Note that I still want the language identifier - ```java - as it is needed by my static site generator. I just don't want it to have any effect in Atom).
As an author, I don't rely too much on syntax-highlighted code snippets anyway as I can see the end result in the static site generator's output.
It's reproducible every time with this file in Atom 0.90.0