in reply to Converting wiki markup to html
Have you considered using Parse::RecDescent for this? I found that a useful way of working for Pod::WikiDoc.
And have you looked at any of the existing modules that do this sort of thing already? Maybe you can adapt or customize one of them instead of writing it from scratch. Here is a list of the ones I know about (I'm sure I'm missing some):
In general, when I've tackled this kind of thing in the past, I found it useful to first parse the text into "chunks" of lines that are of of a particular type (e.g. a numbered list) -- and then to work within each to break down the formatting further. I.e. how do you know when a particular type starts? Once you find that, how do you know when that type ends? The unstructured nature of "wiki" markup makes that a more difficult problem than you might realize.
Good luck.
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Converting wiki markup to html
by slloyd (Hermit) on Feb 13, 2006 at 23:21 UTC | |
|
Re^2: Converting wiki markup to html
by slloyd (Hermit) on Feb 13, 2006 at 19:51 UTC |