Skip to content

Highlighting php without "<?php" #5553

Answered by lildude
fabiospampinato asked this question in Q&A
Discussion options

You must be logged in to vote

If so is that code open source by any chance?

No. It's within the main GitHub.com code which isn't open source. It essentially detects the scope text.html.php and prepends <?php\n to the text if it's not there, colourises it, and then strips it from the beginning of the output before rendering. This only applies to inline code snippets.

If not does anybody have any clues on how to fix this?

Nope, but I know VSCode has the same behaviour:

That said, you're not really comparing like-for-like. Inline snippets are code blocks in Markdown, so if you change your TextMate example to use Markdown, I'd expect you to get the same behaviour. I've not tested it as I don't have TextMate installe…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fabiospampinato
Comment options

Answer selected by lildude
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants