Why not add an id attribute or something so you _know_ you're removing
the tag you added? Also, why not use RegExp()? Otherwise approved!
On 9/17/10 12:57 PM, [email protected] wrote:
Change philip-20100917-feT by phi...@philip-i7 on 2010-09-17 15:47:32 EDT
in /cygdrive/c/clients/laszlo/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: RTE: fix adding/removing <p> tags.
New Features:
Bugs Fixed: LPP-9371 (partial)
Technical Reviewer: max
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Overview:
Details:
My previous changeset was overambitious. Stripping off <p> and </p> from
around the editor should not always be done. For example, if the string
is <p align="right">...</p>, the tags should not be removed.
setText: Add <p> and </p> around the contents only if there is not an
existing <p... at the beginning the of the string.
getText: Strip off <p> and <p> from the string if this is an exact match.
Tests:
/test/components/extensions/test/rte_test.lzx. Click 'Get Text' button
to see that the <p> and </p> are stripped off. Then click the alignRight
toolbar icon and verify that the get text contains a <p> tag around the
text.
Files:
M lps/includes/source/rtemanager.js
Changeset:
http://svn.openlaszlo.org/openlaszlo/patches/philip-20100917-feT.tar