← Back to team overview

launchpad-dev team mailing list archive

Re: lazr-js multiline editor weirdness

 

Hi, Tim.

On Wed, Oct 21, 2009 at 9:28 PM, Tim Penhey <tim.penhey@xxxxxxxxxxxxx> wrote:
> All works well as long as there are no carriage returns.  Once you add some,
> the rendering all goes to pot.
>
> I've verified this with lp:lazr-js example code for the multi-line editor.
>
> What confuses me though is how come the bugs description works?  I can't find
> any difference.
>

Take a look at the activation template string in
lib.canonical.widgets.lazrjs.TextAreaEditorWidget.  There is a
formatter config option that takes the XHTML and formats it nicely.
This has to be done because the xhtml response is in <dd> tags via the
API.  It's also not tested in the lazr-js example because it's
dependent on our real XHR response, so it seemed silly to mock just so
the test formatted nicely.  It's hackish, I know.  But I couldn't
really work out a nicer way to do it.

In other words, the editing is multi-line, but what you display back
on save is dependent on your implementation of the widget.

I meant to document this in someway in the example, though.  But maybe
I didn't.  I can look closer at what's documented there tomorrow.

Cheers,
deryck


-- 
Deryck Hodge
https://launchpad.net/~deryck
http://www.devurandom.org/



Follow ups

References