powered by Jive Software

XHTMLExtensionProvider bug

There is a problem in the XHTML parser.

Say you receive the following message:

Line 1
Line 2
Line 3[/code]

Smack will end up returning the body’'s contents as:

Line 1

Line 2

Line 3[/code]

Take a look at XHTMLExtensionProvider.parseExtension (line 49).

You’'ll notice that START_TAG and END_TAG result in buffer.append(…) call.

But for simple tags like BR you get BOTH a START and END_TAG.

This means the text is appended twice, resulting in the double line break.

I did something like this on line 70 to fix:

String text = parser.getText();

// For simple tags like
we get START_TAG and END_TAG.

// Ignore END_TAG (otherwise it doubles the output).

if (!text.endsWith("/>")) {




I had to fix in our custom build, but if you guys can integrate the fix into the next release that would be splended. :smiley:


John Mickelonis


Thanks for the bug report and recommened fix! I’'ve filed this as SMACK-93.