C# highlighting has long standing problems for me. I'm encountering them mostly in markdown files. I'm using MarkdownEditing package for markdown. The author said that it's not a problem with markdown-plugin itself but with C# highlight package -
https://github.com/SublimeText-Markdown/MarkdownEditing/issues/510
Sublime 3.1 (Build 3170)
An example

If you use a proper Markdown syntax, like the one in this repo, this problem won't happen. I know it's not fun to be given the runaround, but really the problem is with the MarkdownEditing syntax definition not using the embed technology of .sublime-syntax files, meaning MarkdownEditing will have similar problems with many different languages in code fences, as it is not always possible to have no contexts on the stack at the beginning of a line.
I'm sorry, I don't quite understand: what do you mean by "proper Markdown syntax"? Is the syntax in the provided sample not correct? It seems totally legit for me...
really the problem is with the MarkdownEditing syntax definition not using the
embedtechnology of.sublime-syntaxfiles
It's a pity that MarkdownEditing author doesn't realize that..
Could you suggest a more robust Mardkdown plugin that uses a proper definition?
I meant "If you use a proper Markdown syntax definition", apologies for the confusion - the markdown you have written is fine.
What do you want from a Markdown plugin? If you want decent syntax highlighting, don't install any third party packages that contain their own syntax definition, unless it builds on this one using https://packagecontrol.io/packages/YAMLMacros. If you want something else, it's probably best to discuss it on the ST forums.
@keith-hall Complaining about third party packages not using embed keyword is a bit too early as ST3170 is the very first official release supporting that feature! You can't expect package authors to break things for people not able or willing to use the dev builds.
Nevertheless _MarkdownEditing_ should use with_prototype instead to correctly pop off from fenced code blocks at any point.
I'm not a C# expert, but this does seem unexpected to me.

Replacing dynamic with int will make the syntax behave as expected.
Edit: Granted, that was what the referenced issue, https://github.com/SublimeText-Markdown/MarkdownEditing/issues/510, identified. The report at hand is about something else - and something that the default packages handle correctly.
Let me clarify.
The reference issue was actually a problem with c# package and the author was right, and now it's fixed, right? Cool.
But breaking highlighting with not fully complete code that I provided in the first post is another issue and it's inside MarkdownEditing at this time. Right?
What do you want from a Markdown plugin? If you want decent syntax highlighting,
yeah, I just want to have decent syntax highlighing with code fences. MarkdownEditing is very appealing looking hightlighing excepts that it breaks at some code in fences.
don't install any third party packages that contain their own syntax definition,
it's pretty hard to realize from users point of view. But it's a topic for asking at the forum I guess.
Thanks!
Most helpful comment
@keith-hall Complaining about third party packages not using
embedkeyword is a bit too early as ST3170 is the very first official release supporting that feature! You can't expect package authors to break things for people not able or willing to use the dev builds.Nevertheless _MarkdownEditing_ should use
with_prototypeinstead to correctly pop off from fenced code blocks at any point.