Closed HedgehogNSK closed 4 months ago
The code you provided auto-detects to scss.
scss: relevance 21, csharp: 19
I don't know how to "fix" it, or even if it needs to be fixed. Auto-detect is difficult and should probably not be used, as it will be deprecated with v12.0 anyway, I believe. It's best to specify the language for each of your snippets.
Yeah, we make no guarantees about auto-detect, it's more of a toy than a precision tool. Specify the language and you'll get much better results.
Describe the issue Hello. I'm using your extension for blogger platform. I just found out that if sample of code doesn't contain any variable assignment, then highlighter doesn't determine that the language of a sample is C#. I use "vs2015" style template
Are you using
highlight
orhighlightAuto
? I use snippet from the highlight homepage. If this question asks do I set language name in<code>
tag explicitly? Then the answer is: I tried them both to determine the issue.Sample Code to Reproduce
When I don't set language explicitly![image](https://github.com/highlightjs/highlight.js/assets/23266328/385996ee-1525-4c6e-b383-678bf032989a)
<code>
:When I set language explicitly![image](https://github.com/highlightjs/highlight.js/assets/23266328/c38265c7-2497-4474-8390-e0def1d8e0f6)
<code class="cs">
:When I don't set language explicitly, but I add assignment of some value (ex.![image](https://github.com/highlightjs/highlight.js/assets/23266328/86f95c9c-ead2-45b6-b93b-28ce6f3ac87a)
var x = 1;
):Expected behavior