1 package org.simantics.scl.compiler.markdown.nodes;
3 import org.simantics.scl.compiler.markdown.html.HtmlGenerationContext;
5 public class ItemNode extends Node {
6 public int indentation;
8 public ItemNode(int indentation) {
9 this.indentation = indentation;
13 public boolean canContain(Node node) {
17 public void toHtml(HtmlGenerationContext context, StringBuilder b) {
18 toHtml(context, b, true);
21 public void toHtml(HtmlGenerationContext context, StringBuilder b, boolean tight) {
22 if(firstChild == null) {
23 b.append("<li></li>\n");
28 // This code assumes that there are no consecutive paragraphs
29 boolean noNewline = true;
30 for(Node child = firstChild; child != null; child = child.next) {
31 if(child instanceof ParagraphNode) {
32 for(Node n=child.firstChild;n!=null;n=n.next)
41 child.toHtml(context, b);
48 super.toHtml(context, b);