carbonate icon indicating copy to clipboard operation
carbonate copied to clipboard

Language detection not working correctly

Open Pencilcaseman opened this issue 2 years ago • 3 comments

I think there is an issue with the automatic language detection, as the code highlighting doesn't appear to match the language being used.

For example, if I put this code directly into Carbon (with language="auto"), I get the following output:

carbon (4)

However, if I put the exact same code into an issue it doesn't get formatted in the same way (using all default settings):


View raw code

# This is a comment
def main():
    print("Hello, World")

Pencilcaseman avatar Feb 05 '22 12:02 Pencilcaseman

So - just a heads up - for python, it seems like the official plugin has been deprecated and they recommend to use Black instead.

So it appears that I may not be able to support python just yet. Will still keep this ticket open to allow supporting other plugins

callmekatootie avatar Feb 07 '22 04:02 callmekatootie

That's interesting. Thanks for the quick reply! Re-reading my issue, however, I think I mis-phrased my question and meant that the syntax highlighting isn't quite the same. Is there a way I can make it automatically change based on the language?

Pencilcaseman avatar Feb 07 '22 11:02 Pencilcaseman

By default, prettier support web based languages (js, html, css...)

So, the syntax highlighting does (should) detect the language to apply the style. Except it does not support all the languages. I need to check how carbon's website does it

callmekatootie avatar Feb 07 '22 11:02 callmekatootie