1 package org.simantics.scl.compiler.markdown.nodes;
3 import org.simantics.scl.compiler.markdown.html.HtmlGenerationContext;
5 public class ListNode extends Node {
6 public char bulletChar;
10 public ListNode(char bulletChar) {
11 this.bulletChar = bulletChar;
14 public ListNode(char bulletChar, int start) {
15 this.bulletChar = bulletChar;
20 public boolean canContain(Node node) {
21 return node instanceof ItemNode;
24 public boolean isCompatible(char bulletChar) {
25 return bulletChar == this.bulletChar;
29 public void toHtml(HtmlGenerationContext context, StringBuilder b) {
30 if(bulletChar == '+' || bulletChar == '-' || bulletChar == '*') {
32 for(Node child = firstChild; child != null; child = child.next)
33 ((ItemNode)child).toHtml(context, b, tight);
40 b.append("<ol start=\"").append(start).append("\">\n");
41 for(Node child = firstChild; child != null; child = child.next)
42 ((ItemNode)child).toHtml(context, b, tight);