Forum OpenACS Development: Re: enhanced text format and line breaks

Collapse
Posted by Janine Ohmer on
I found the code you're referring to in template::util::richtext::get_property, but it's only executed if you set "what" to html_value.  All of the examples of this I see in lars-blogger and bug-tracker used contents, which is what I was using, and that just returns the raw value.

So I tried using html_value instead, with a message that looked like this:

line1
line2

line4

It looked right on the confirmation page, but the final message ended up like this:

line1

line2

line4

I am guessing this is because the html conversion got run on it twice.  Is this correct, that I should rework this so it's only run when going to the confirm page?  And why don't I see bug-tracker or lars-blogger doing it this way?  I feel like I must be missing something,

Collapse
Posted by Lars Pind on
Yeah, you probably need to export the html_value separately, so what gets exported to the actual post page is the original value, which is a list of (content, mime_type).

I've been thinking about extending the form builder with a "oonfirm" mode, in addition to edit and display, to handle all of this properly, but I haven't done anything about this yet.

/Lars