Monday, Debtember 06, 2004
& … or something like that …
I made some more tweaks to the demo program; it now supports a “mixed”
mode—you can type in HTML tags, but the system will add
<P> tags if you leave a blank line between paragraphs (in
fact, it was only five lines of C code—easier than I thought).
There's still one bug and it has to deal with HTML entity encoding (and mostly with populating
the <TEXTAREA> with the text that was submitted). Type
“&” (which is the HTML entity for a lone “&”) then submit
the data. The <TEXTAREA> will come back with a lone
“&” where you typed “&” before. Basically, to display
“&” you need to display “&amp;” (and to display
that I had to type “&amp;amp;”—I think I got the right
number of “amp;s”).
Ow—my brain hurts (and if the above is incorrect, I'm not bothering to fix it—which goes to show you how nasty this little problem is).
Oh, the demo program—it also supports a few shortcuts, like “---” (three dashes in a row) will be converted to “—” (the em-dash, and the code that processes entries for this blog will do the same, so check the source if you want to see how I got around that—geeze, this sef-referential stuff will kill me!) and “...” (three periods) will be converted to “…” (elipsis—it's own character); some short-cuts like that (and these shortcuts happen in any of the modes by the way).
Okay, I'm going to lie down now.
![Staying cool on a hot day [Staying cool on a hot day]](http://www.conman.org/people/spc/about/2010/0731.t.jpg)