I have a question about my Stack Overflow post: How can I change a TextInput's selection and fire its onSelectionChange event in unit testing?
I have some code blocks in my question and my self-answer. Every single one of the code blocks has syntax highlighting declared for either ts
or tsx
, like this:
```tsx
some code here
```
What is syntax highlighting and how does it work? says this should be just fine as a way to declare my syntax highlighting and tsx
is a supported name. And yet, I have no syntax highlighting! This is a screenshot:
Even the pure ts
block doesn't have syntax highlighting.
I can see syntax highlighting in other posts. Why is processing a sorted array faster than processing an unsorted array? has colored text just fine, as in this screenshot:
Even more surprisingly I can actually get working tsx syntax highlighting elsewhere on the site for this exact code—I had it while using the rich text editor on the ask a question page! If I copy my code over there now, wrapped with tsx
code block markdown as seen at the top of this post, I get exactly the syntax highlighting I'd expect. Here's a screenshot of it, with a peek at the markdown so you can see it's exactly the same kind of code block I'm using in my question: