[pmwiki-users] capital first letters

Patrick R. Michaud pmichaud at pobox.com
Thu Jun 30 08:31:29 CDT 2005


On Thu, Jun 30, 2005 at 02:07:02PM +0100, Hans wrote:
> ## firstcap markup
> Markup('firstcap','block','/^([[:upper:]])(.*)$/',
>                 '<:block><p class=\'firstcap\'>$1$2</p>');

Another way to do this is to actually look for the <p> tags
after things have been converted into paragraphs and styled.  Thus:

Markup('firstcap', '>%%',
  '/<p>((<[^>]*>)*[[:upper:]])/',
  '<p class=\'firstcap\'>$1');

This even handles the case where other tags have been inserted between
the initial paragraph tag and the first letter of the paragraph.

Then CSS styling can be done using "p.firstcap" as the selector.

Pm



More information about the pmwiki-users mailing list