atom / markdown-preview

📝 Markdown preview in Atom
MIT License
1.23k stars 358 forks source link

PHP snippets should be syntax-highlighted #307

Open rugk opened 9 years ago

rugk commented 9 years ago

I feel like I already created an issue in this or another repo, but I cannot find it, so here is a new one:

The problem is the PHP syntax highlighting acts the same in the `` code tags of markdown. And as PHP normally requires<?phpat the top text without<?phpis not syntax-highlighted. However as you mostly only use snippets of PHP in markdown files and not whole markdown files it's quite probably that there is no<?php` tag in it.

markdownpreview_phpsnippets Code: https://gist.github.com/rugk/063f2bac1e619422ea5f

bbailleux commented 8 years ago

This feature also miss me. The " ```php " should fire the PHP renderer, whatever the content is.

winstliu commented 8 years ago

It does use the PHP grammar, but the grammar doesn't match anything because of the missing <?php.

rugk commented 8 years ago

grammar doesn't match anything because of the missing <?php.

And that's the issue.... And I've already opened an issue in the language-php repo, but there was no comment until now.

jamesratcliffe commented 6 years ago

I don't know if this is the same issue or not, but it also won't switch back to regular markdown highlighting if you don't have a closing ?>.

Ex: screen shot 2017-11-16 at 3 40 18 pm

It's common to omit the closing ?> in a pure PHP file.

winstliu commented 6 years ago

@jamesratcliffe you might want to subscribe to atom/first-mate#83.