int height= trim.height;
//FIXME: The HTML2TextReader does not render <p> like a browser.
// Instead of inserting an empty line, it just adds a single line break.
// Furthermore, the indentation of <dl><dd> elements is too small (e.g with a long @see line)
TextPresentation presentation= new TextPresentation();
HTML2TextReader reader= new HTML2TextReader(new StringReader(fInput.getHtml()), presentation);
String text;
try {
text= reader.getString();
} catch (IOException e) {
text= ""; //$NON-NLS-1$
}
fTextLayout.setText(text);
fTextLayout.setWidth(sizeConstraints == null ? SWT.DEFAULT : sizeConstraints.x - trim.width);
Iterator iter= presentation.getAllStyleRangeIterator();
while (iter.hasNext()) {
StyleRange sr= (StyleRange)iter.next();
if (sr.fontStyle == SWT.BOLD)
fTextLayout.setStyle(fBoldStyle, sr.start, sr.start + sr.length - 1);
}