Bug 21866 - wordWrap incorrect behavior with delimiter
Summary: wordWrap incorrect behavior with delimiter
Status: RESOLVED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: String Taglib (show other bugs)
Version: 1.0.1
Hardware: All All
: P3 critical (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-24 20:49 UTC by Vladyslav Kosulin
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladyslav Kosulin 2003-07-24 20:49:33 UTC
if I use
<str:wordWrap width="15"
delimiter="&lt;BR&gt;">1234567890123456789012345</str:wordWrap>
I get the following output:
123456<BR>789012<BR>345678<BR>901234<BR>5 
It looks like it calculates the delimiter length (10 characters in this case)
and adds it to the length of the string to be split to compare to the width+1.
I guess, this is not an expected behavior. It should treat the delimiter out of
calculations and apply width to the string itself.
Comment 1 Felipe Leme 2004-03-09 01:12:35 UTC
Vladyslav,

This tag definition states that: this involves formatting a long String to fit
within a certain character width of page.

So, if we don't take the delimiter's length into account, the chunks won't fit
into that width.

On the other hand, it also says that: A delimiter may be passed in to put at the
end of each line.

In other words, the current definition is dubious about where the delimiter
should be include. So, I will fix this bug including a new attribute for the tag:

delimiterInside - flag indicating if the delimiter should be included in chunk
before length reaches width. Default is true.


Comment 2 Felipe Leme 2004-03-10 03:28:40 UTC
Fixed (and new version available through nightly build)