#941 closed enhancement (maybelater)
Code blocks in WikiFormatting specifying PHP should always syntax-highlight as PHP
Reported by: | westonruter | Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Component: | Trac | Keywords: | |
Cc: |
Description
Take for example: https://core.trac.wordpress.org/ticket/31550#comment:description
If you add a triple-brace code block and specify it as being #!php
it will not highlight the contents as PHP code unless a <?php
appears. I suggest that the formatting logic infer a <?php
at the beginning of the code block if none exists, and in this way it will get highlighted as expected.
Change History (3)
Note: See
TracTickets for help on using
tickets.
This is doable in Trac 1.1, currently in development.
http://trac.edgewall.org/changeset/14207
I tried to backport that, but it got messy really quickly, so we may just need to wait, unless someone wants to take a crack at getting it to work. My take is if you already know to do
#!php
then you will also know to do<?php
, so it's not like removing it will help much more PHP be rendered properly. So I'm going to close this as "maybelater".I bet @ocean90 could make a PHP toolbar button that spits out
{{{\n#!php\n<?php\n\n}}}\n
.