Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#941 closed enhancement (maybelater)

Code blocks in WikiFormatting specifying PHP should always syntax-highlight as PHP

Reported by: westonruter's profile westonruter Owned by:
Milestone: Priority: low
Component: Trac Keywords:


Take for example:

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)

#1 @nacin
9 years ago

  • Resolution set to maybelater
  • Status changed from new to closed

This is doable in Trac 1.1, currently in development.

php.startinline = true

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.

#2 @ocean90
9 years ago

In 1994:

Trac: Add a PHP button to the formatting toolbar that spits out {{{#!php\n<?php\n\n}}}\n.

See #941.

#3 @DrewAPicture
9 years ago

Wow, that's just cheatin'!

Note: See TracTickets for help on using tickets.