[Pmwiki-users] Re: Acrobatics while typing [:...:] and math markup

chr@home.se chr
Fri Oct 1 13:44:38 CDT 2004


On Fri, 1 Oct 2004, Patrick R. Michaud wrote:

> On Fri, Oct 01, 2004 at 06:04:48PM +0200, chr at home.se wrote:

> Basically we only translate matching sets of (: ... :) regardless of
> what occurs in-between.  The PmWiki v2 code would be:
> 
>    $ROSPatterns['/\\(:.*?:\\)/'] = '[:$1:]';

Would this also handle something like this:

	some long complicated text (:Some directive \
	continued directive:)

Or is line continuation not allowed inside directives?

> Doesn't need to -- it's looking for the (: ... :) pattern, not the
> directive name.

Ok, so it's only a matter of really bad luck if an author would manage to 
write something like:

	I was miserable when I woke up (:, but then I got cake :)

which then on save would be converted into:

	I was miserable when I woke up [:, but then I got cake :]

Anyway, this seems very unlikely, so I could probably live with it that 
minor problem.

Just like we have a 'replace on save pattern', could we have a 'replace
before edit pattern'? The idea is that this pattern would replace all
[:xxx:] with (:xxx:) before the author sees the source in the edit form.

I'm still not so comfortable with this idea... the author won't actually 
be seeing the "real" code. But maybe that doesn't matter?

/Christian

-- 
Christian Ridderstr?m, +46-8-768 39 44               http://www.md.kth.se/~chr




More information about the pmwiki-users mailing list