Wiki JS
September 11th, 2004 by HenIn lieu of hunting down other things that do the same thing, and for the sheer fun of it, I now have a function that does wiki javascript.
The support is now:
- Two _ for bold.
- Two { for code.
- Two = for underline.
- Two ‘ for italic.
- Bullets work via * and #, with nesting done via increasing *’s etc.
- Newlines are maintained.
- A final newline is added (due to either the theme or roller’s habit of putting the comment link etc right on the end of the entry)
- h1 through to h5 via ! marks
- Hard breaks via a backslash on the end of a line
- hr’s via 4 or more -’s.
No ability to escape things though, thus the lack of examples above.
It’s all in Javascript, so as soon as you click out of the Textarea it transforms into HTML. I’ve not yet found a point where re-editing the HTML caused a second change that was not desired, but I’m sure such a bug could exist.
Even if things do screw up, you can still edit the HTML afterwards. Only bug I’ve noticed is that the end of a UL tends to get two newlines with the way I tend to type.

September 11th, 2004 at 2:04 pm
Two more bits.
I fixed the theme’s lack of newline after entries once Carrie hit me with a dumb-stick. No idea how I missed that before.
Also put in a hack for CSS. A ul in a p messes up css as the spec says that ul and p are the same level and Roller wraps the entry in a p. So when my wiki text creates a ul, it closes the p behind and opens it again after the closing ul.