[Solar-talk] retain line breaks/newline
Paul M Jones
pmjones at solarphp.com
Mon Aug 7 09:00:07 PDT 2006
On Aug 7, 2006, at 10:26 AM, Rodrigo Moraes wrote:
> On 8/3/06, Antti Holvikari wrote:
>> So what I ended up doing was to use Text_Wiki markup and store
>> that "as-is" to the db. Then I made a helper to transform that to
>> XHTML with Text_Wiki. Works *exactly* as I want.
>
> Antti, you have made me interested in Text_Wiki, and reading about its
> capabilities I got even more interested.
Text_Wiki has the drawback of being PHP4 only; if you code to
E_STRICT you're going to get lots of error notices (although it works
just fine).
Am currently working on an updated version of it for Solar, based
more on [Markdown][] rules than generic wiki rules.
[Markdown]: http://daringfireball.net/projects/markdown/syntax
Also, with the new parser, the only rendering format will be XHTML
(rather than any output format). I figure if you need RTF, PDF,
LaTeX, etc. then it'll be easier to use existing tools to convert
from XHTML as a second transformation step. Having one target format
makes it a hell of a lot easier to write rendering logic.
> I have a trivial question, though (couldn't find an answer in the
> docs): do you know if Text_Wiki can convert basic xhtml to wiki
> markup? I just need to convert really basic markup: em, i, b, strong,
> and href.
I don't think the package comes with an html-to-wiki renderer; that's
kind of outside the scope of the project anyway.
--
Paul M. Jones <http://paul-m-jones.com>
Solar: Simple Object Library and Application Repository
for PHP5. <http://solarphp.com>
Savant: The simple, elegant, and powerful solution for
templates in PHP. <http://phpsavant.com>
More information about the solar-talk
mailing list