Quoting Nicolas Serrador Ivering <[EMAIL PROTECTED]>:
> I have a question about the isEmpty-method in Chunk. Right now it looks
> like this:
>
> public final boolean isEmpty() {
> return (content.toString().trim().length() == 0) && (attributes ==
> null);
> }
>
> and thus finds a chunk representing a newline ('\n') to be empty since
> trim() deletes the newline character. Wouldn't this implementation be
> better?
>
> public final boolean isEmpty() {
> String contentString = content.toString();
> return (!contentString.startsWith("\n")) &&
> (contentString.trim().length() == 0) && (attributes == null);
> }
>
> I'm fairly new to iText so I could be wrong here but i do know that
> HtmlWriter will not translate newlines into <br />-tags with the current
> implementation.
You are right, I should probably add something like
contentString.indexOf("\n") == -1
I'll add this in the next release.
kind regards,
Bruno
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions