We add support to code blocks with the language expressed as GitLab/GitHub/StackOverflow/...
"flavored markdown".
So we support this syntax: (to avoid confusion see it online on the Diff)
```php $asd = 1; ```
Before this change, this was the only supposed syntax in Remarkup, with an explicit "lang=":
```lang=php $asd = 1; ```
This change introduces a minor risk to eat legitimate Remarkup content, since Remarkup allows
to do a multi-line in this way:
```$asd = 1; $asd = 2;```
The above example still works, but, there is a chance that hardcore Remarkup people
have a problem when doing a code block to mention programming languages.
In short, this can be problematic since "cpp" will be eaten from this list:
```cpp php python ```
Using the above example is not socially nice because it is not usable in GitLab, GitHub and Stack Overflow.
If your first line is eaten:
Just *add* a newline on the top to reach a valid raw Markdown list (suggested, valid in Remarkup + Markdown):
``` cpp php python ```
Or, just add "text" to specify that as language (suggested, valid in Remarkup + Markdown):
```text cpp php python ```
Or, just *remove* a newline from the bottom to reach a valid raw Remarkup list (Remarkup-only):
```cpp php python```
Or, just specify that you are writing in the language "text" (Remarkup-only):
```lang=text cpp php python```
To reduce impact and help you, the logic of this strict implementation is:
- must have backticks
- must not have any valid remarkup option, like lang=, counterexample, etc.
- must not have content in the same line of the last backticks
- must have a known language in our proposed subset
If everything is OK, we remove that language from the content since it would be otherwise displayed.
Interestingly, this could improve performance when rendering README files or snippets from external
websites, since - in case - we do not need to guess the language using our deep dark magic.
Closes T15481