[cl-wiki-devel] Re: New Release CL-WIKI 0.0.4
Stefan Scholl
sscholl at common-lisp.net
Wed Sep 7 21:48:32 UTC 2005
On 2005-09-07 08:58:35, Vehbi Sinan Tunalioglu wrote:
> Formatting lists is a matter of following the context. We should first
> start an <ul> or <ol> if and only if the list item is the first list
> item of the following item sequence and close it when the sequence is
> finished. We should use some flags for this process. Any other idea?
I've changed the way translation is done with 0.0.4. Now it's
only one *REPLACE-LIST* and one function TRANSLATE-WIKI-CODE.
The magic lies within CL-PPCRE's REGEX-REPLACE-ALL which can have
a really complex replacement parameter:
http://weitz.de/cl-ppcre/#regex-replace
To replace [[foo]] with an internal link with URL encoded page
name:
("\\[\\[(.*?)\\]\\]" . ,(list "<a href=\"" 'rep-url-encoder-1 "\">" 0 "</a>"))
The register counting starts at 0 when you use this notation. And
the best part is the function designator! Wonderful things could
be done with this.
I've just tested a Regex in The Regex Coach
<http://weitz.de/regex-coach/> which could be used for lists.
I'll try to implement it tomorrow.
Here's the regex: ^\*.*?(?=^[^\*]|\z)
(with m and s active - multi-line-mode and single-line-mode)
This has matched a complete bullet list with a "*" on the
beginning of each line.
Regards,
Stefan
More information about the Cl-wiki-devel
mailing list