WordPress.org

Making WordPress.org

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#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)

#1 @nacin
4 years ago

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

This is doable in Trac 1.1, currently in development.

[pygments-lexer]
php.startinline = true

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.

#2 @ocean90
4 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
4 years ago

Wow, that's just cheatin'!

Note: See TracTickets for help on using tickets.