6

We can create syntax highlighting on stackoverflow with the following format:

```{language}
code here
```

If the language is Python, you'll get syntax highlighting in preview, but not after you submit the post. If the language is py you'll get syntax highlighting both in preview and after you submit the post.

Please make them consistent. My preference is the behavior of preview, because that makes it easier to guess what language tags will work.

3

1 Answer 1

3

This was a left over difference between preview and rendered content even after the fix as detailed Preview syntax highlighting doesn't match display when submitted

This actually caught a separate bug that the preview would allow an alias that is case insensitive and the server side validation was case sensitive.

This has now been resolved as we ignore casing on both server and client side.

lang-Python

def print_hello_world():
  print("Hello, world!")

lang-python

def print_hello_world():
  print("Hello, world!")

Python

def print_hello_world():
  print("Hello, world!")

python

def print_hello_world():
  print("Hello, world!")

Thanks for reporting!

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.