#1709 - Safety for syntax highlighers in JS/CSS re Tempcode

Identifier #1709
Issue type Feature request or suggestion
Title Safety for syntax highlighers in JS/CSS re Tempcode
Status Completed
Handling member Chris Graham
Addon core
Description New syntax for directives, e.g.:
/*START,IF,{$IS_MOBILE}*/
/*END,IF*/

(Symbols and language string references should be fine as-is, as those will already be going inside string quotes)

Add a little extra code to our Tempcode parser:
$code=preg_replace('#\/\*((START|END),.*)\*\/#U','{+$1}',$code);

Document the new syntax.

Apply to default templates.

Test the changes templates parse correctly.
Steps to reproduce

Funded? No
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Rating

Unrated