We are pleased to announce one more feature to help you get to Clean Code faster.
Following the addition of ‘diff’ highlighting, we are adding syntax highlighting to noncompliant and compliant code examples. This should make it easier to see what updates are needed:
I just noticed that after upgrading to version 10.2. That is great!
I develop my own plugin and I’d like to be able to sometimes bypass language auto-detection.
I tried to add something like that in my HTML rule description file but it does not work:
Thank you for your feedback. Could you say a little bit more about what you would like to do, please? Are you trying to turn off the syntax highlighting completely or specify the particular language(s) that the code example is written in? What sort of results are you getting today?
We have been discussing adding the ability to specify the language of a code example, but haven’t got a plan for when this might be delivered at the moment.
For instance, for the following piece of code, I’d like no highlighting (or plaintext highlighting) according to the framework you’re using for highlighting:
It does it by putting backticks around each individual word:
To be noted that some construct such as `isset()`, `exit()` or `array()` does require them.
Here is the list of constructs for which parentheses could be used but should be avoided :
`return`, `echo`, `break`, `clone`, `case`, `continue`, `include`, `include_once`, `require`, `require_once`, `print`, `return`, `throw`, `yield`, `yield from`
There must be some kind of rule description html processing on your side before generating the plugin because I don’t get the same output on my side with the same piece of html:
On your side:
Could you please ask somebody from your dev team about it?