You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it is not possible to highlight PHP code that does not start with either <?php or <?. Pygments has the option startinline to indicate this exact case. Would it be possible for chroma to support a similar feature? This is essential for PHP snippet highlighting.
I am happy to provide a PR and already had a quick look at the code. One solution might be to change the starting state in the TokeniseOptions for the Tokenise function from "root" (the default) to "php" in the client application. This inline starting rule could be a new configuration parameter in the lexer. It would not change the external API much but would still provide a relatively easy and generalized way of dealing with such cases.
The text was updated successfully, but these errors were encountered:
Yes, this is definitely something I'd like to support. I have some code that is somewhat working. Pygments uses a DelegatingLexer to implement this feature. The logic to achieve this is actually quite complex, so my code isn't working correctly yet, and I haven't had the time to debug it.
If you'd like to take a crack at it, I'd be happy to accept it.
Currently it is not possible to highlight PHP code that does not start with either
<?php
or<?
. Pygments has the option startinline to indicate this exact case. Would it be possible for chroma to support a similar feature? This is essential for PHP snippet highlighting.I am happy to provide a PR and already had a quick look at the code. One solution might be to change the starting state in the
TokeniseOptions
for theTokenise
function from "root" (the default) to "php" in the client application. This inline starting rule could be a new configuration parameter in the lexer. It would not change the external API much but would still provide a relatively easy and generalized way of dealing with such cases.The text was updated successfully, but these errors were encountered: