[pmwiki-users] CSS and Markup function

Patrick R. Michaud pmichaud at pobox.com
Mon Feb 13 16:55:18 CST 2006


On Mon, Feb 13, 2006 at 05:19:50PM -0500, Charles Little wrote:
> Hello-
> 
> I changed a wiki group so that it could use a specific css file.  All was
> well, except for the fact that the colors on the sidebar didn't go well with
> the background image.  So I wanted to change the decorations on the links in
> the side/nav bar.  I added a decoration class for utility, and edited the
> config.php to include the following statement:
> 
> Markup("div", "<inline", "/<:(.*?):>/", "<div id='utility'>$1</div>");
> 
> So I was wondering 1) what I was doing wrong, 

By the time you get to processing markups, the '<' and '>' characters
have already been converted to '&lt;' and '&gt;'.  So, your pattern
probably needs to read:

   Markup("div", "<inline", 
     "/&lt;:(.*?):&gt;/", 
     "<div id='utility'>$1</div>");
    
> 3) are markups added by the Markup command multiline, and if not,
> is it possible to make them multi-line.

Markups can indeed be multiline, but they have to be defined prior
to the 'split' markup rule (normally one can use 'fulltext' for this),
and we have to remember that the regexp '.' doesn't match a newline
unless the /s flag is given.  Thus you'd need something like:

   Markup("div", "fulltext",            # note 'fulltext' instead of 'inline'
     "/&lt;:(.*?):&gt;/s",              # note /s flag on pattern
     "<div id='utility'>$1</div>");

An example of a multiline markup in PmWiki is the (:if:)
markup, defined in scripts/stdmarkup.php .

Pm




More information about the pmwiki-users mailing list