Forum OpenACS Development: Re: Rich text input

Collapse
7: Re: Rich text input (response to 1)
Posted by Lars Pind on
Ola,

Yes, we never alter the user's input before storing it in the DB, only on output.

Regarding a multitude of formats, sure, but we might as well try to come up with one that we think is probably the best, the one that we'd use on openacs.org, say.

Btw, right now I'm trying to figure out what to do with links. I added the turning URLs into links, but now it conflicts with your own manual links: If you write <a href="http://foo.bar">link</a>, it's translated into <a href="<a href="http://foo.bar">http://foo.bar</a>">link</a> ...

Anyway, will keep hacking on this a bit.

/Lars

Collapse
25: Re: Rich text input (response to 7)
Posted by xx xx on
Lars,

Concerning your remark on 26/1 (10.07): do <a href=>-tags work properly with richtext widgets?

I'm using the richtext widget with 4.6.3 (final) but still get this as output:

<p><a href="http://test.nl">link</a></p>
<input type="hidden" name="pa" value="<a href="http://test.nl">link</a>"><input type="hidden" name="pa.format" value="text/enhanced">

I would like to get rid of the <p> as well as the resulting ' link"> ' displayed in the browser.

Collapse
26: Re: Rich text input (response to 25)
Posted by Lars Pind on
The resulting ' link"> ' is a quoting bug, which I've just now fixed on HEAD:

http://cvs.openacs.org/cvs/openacs-4/packages/acs-templating/tcl/richtext-procs.tcl.diff?r1=1.5&r2=1.6&f=h

The <p> ... </p> around the contents is an attempt to make the  output proper HTML, but it does result in annoying whitespace.

Any better suggestion? Should we resort to open-ended <p>'s between paragraphs like we used to?

The code that does this is these two lines in util_convert_line_breaks_to_html in packages/acs-tcl/tcl/text-html-procs.tcl, in case you want to take it out on your own system:

    # Wrap P's around paragraphs
    set text "<p>$text</p>"
    regsub -all {([^\n\s])\n\n([^\n\s])} $text {\1</p><p>\2} text

/Lars

Collapse
27: Re: Rich text input (response to 26)
Posted by xx xx on
Thanks for fixing this bug.

As far as I can see "<p> ... </p> around the contents" prevents us from using this formwidget inline. An inline_p switch would therefore be useful, IMO.