[Pmwiki-users] %class=something% (was Re: Extending ...)

Nathan Jones nathanj
Mon Mar 1 18:56:05 CST 2004


Pm wrote:
>Historically I've reserved the '=' at the beginning of a line
>for customized markup.  Thus, if someone wants block-level items you
>can define a markup such as:
>
>    =note  This is a note in a div with class='note'
>
>by adding the following to local.php

True, but the beauty of having a markup specifically for assigning
classes is that you don't have to define a markup every time you add a
class. Have you seen Richard's post (Subject: Span and Div) suggesting
[[div]]?

>   $InlineReplacements['/^=note (.*)$/'] = "<div class='note'>$1</div>";

I guess it would be possible to expand this to recognise =class-foo:

$InlineReplacements['/^=class-([a-zA-Z]*) (.*)$/'] = "<div
class='$1'>$2</div>";

I have no idea if that works. I don't play with regexps much. :-)

-- 
Nathan Jones



More information about the pmwiki-users mailing list