Closed barrycohen closed 1 year ago
Fixes a logic error which causes the language prop to be ignored unless autodetection is explicit disabled.
For example, in 2.1.2, the following is highlighted as cpp rather than shell, even though we have asked for shell:
cpp
shell
<highlightjs language="shell" code="#include <iostream>"></highlightjs>
I've tested the fix over a wide range of cases. The example code I used is
#include <iostream>; import os
because it is autodetected as stan but renders differently for stan, cpp and shell, which means you can visually tell how it has been highlighted.
stan
I believe the fix provides reasonable results in all cases.
Fixes #41.
Awesome, also will need to update the CHANGELOG.
Good point, thanks. ChangeLog updated. I've assumed the change will go into 2.1.3.
Fixes a logic error which causes the language prop to be ignored unless autodetection is explicit disabled.
For example, in 2.1.2, the following is highlighted as
cpp
rather thanshell
, even though we have asked forshell
:I've tested the fix over a wide range of cases. The example code I used is
because it is autodetected as
stan
but renders differently forstan
,cpp
andshell
, which means you can visually tell how it has been highlighted.I believe the fix provides reasonable results in all cases.
Fixes #41.