#157 More flexible handling of {{ }} syntax

1.3.x
closed
Reini Urban
None
5
2012-10-11
2007-06-07
aljeux
No

Hi,

We have modified class Markup_template_plugin in file InlineParser.php to have a more flexible handling of {{ }} syntax.

With the patch, you have the following improvements:

1) The {{ }} code can be put on several lines.

You can now write:

{{
minutes
|title=Meeting Minutes: Internal review
|date=2007-05-07
|attendees=[John Smith], [Barbara Martin]
|to=attendees
|status=draft
}}

that is more readable than

{{minutes|title=Meeting Minutes: Internal review|date=2007-05-07|attendees=[John Smith], [Barbara Martin]|to=attendees|status=draft}}

2) You can put multiple {{ }} on the same line.

dasdsadasd {{foo}} dfdsfsdfsdfsd {{bar}} fdsfsd

will work

3) The template name can be one letter only.

sdfsdfsdf {{a}} dfdsfsdf

will work

Patch made on file:
rcs_id('$Id: InlineParser.php,v 1.70 2005/10/31 16:45:23 rurban Exp $');

I hope it does not break anything. It works for us in all tests we have made.

Discussion

  • aljeux
    aljeux
    2007-06-07

    Patch file for InlineParser.php

     
    Attachments
  • Reini Urban
    Reini Urban
    2007-06-07

    Logged In: YES
    user_id=13755
    Originator: NO

    Thanks. I'll test why I didn't do the obvious in the first place.

     
  • Reini Urban
    Reini Urban
    2007-06-07

    Logged In: YES
    user_id=13755
    Originator: NO

    Thanks. Will be in the upcoming 1.3.13p1 patchfix release.

            $vars = '"' . preg_replace('/\|/', '" "', $_m[2]) . '"'; 
            $vars = preg_replace('/"(\S+)=([^"]*)"/', '\\1="\\2"', $vars);