package org.simantics.scl.compiler.markdown.nodes; public class ListNode extends Node { public char bulletChar; public boolean tight; public int start; public ListNode(char bulletChar) { this.bulletChar = bulletChar; } public ListNode(char bulletChar, int start) { this.bulletChar = bulletChar; this.start = start; } @Override public boolean canContain(Node node) { return node instanceof ItemNode; } public boolean isCompatible(char bulletChar) { return bulletChar == this.bulletChar; } @Override public void toHtml(StringBuilder b) { if(bulletChar == '+' || bulletChar == '-' || bulletChar == '*') { b.append("\n"); } else { if(start == 1) b.append("
    \n"); else b.append("
      \n"); for(Node child = firstChild; child != null; child = child.next) ((ItemNode)child).toHtml(b, tight); b.append("
    \n"); } } }