package net.sf.jpluck.plucker.parsing.html;
import net.sf.jpluck.plucker.Text;
import net.sf.jpluck.plucker.parsing.Element;
public class DefinitionItemHandler implements TagHandler {
public void start(HTMLSerializer ser, StyledElement elem) {
Element parent = elem.getParent();
if (parent.getQName().equals("dl")) {
Style style = new Style();
style.setMarginLeft(ser.scaledValue(12));
elem.setStyle(style);
ser.addParagraph(0);
} else {
Style style = elem.getCascadedStyle();
ser.addParagraph(0).addMargin(style.getMarginLeft() + 12, style.getMarginRight()).
addText(Text.createNonBreakingSpace()).addMargin(style.getMarginLeft(), style.getMarginRight());
}
}
public void end(HTMLSerializer ser, StyledElement elem) {
ser.addParagraph(0);
}
}