Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.5.5
-
None
Description
Hi,
I have custom component (extends MarkupContainer implements IMarkupCacheKeyProvider, IMarkupResourceStreamProvider) which fetches its HTML markup from database.
Following HTML markup:
<img alt="" src="logo.png">
<br>Some text
<br>Some more text
causes following error:
2012-04-12 10:52:53,012 [http-8080-6] ERROR: Unexpected error occurred
Unable to find close tag for: '<img alt="logo" src="logo.png">' in org.apache.wicket.util.resource.StringResourceStream@3d7e16fc
MarkupStream: [unknown]
at org.apache.wicket.markup.MarkupFragment.<init>(MarkupFragment.java:127)
at org.apache.wicket.markup.MarkupStream.getMarkupFragment(MarkupStream.java:485)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:244)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1421)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1596)
at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1571)
at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1525)
I think the problem is that org.apache.wicket.markup.parser.filter.HtmlHandler does not handle such markup correctly. It does not call ComponentTag.setHasNoCloseTag(true) for the img tag. Such call is missing in postProcess() method. I think that this problem can be fixed by inserting:
top.setHasNoCloseTag(true);
after line 80 in HtmlHandler.java file.
Michal