docs: public void emit(final StringBuilder out, final Block root)
      {
          root.removeSurroundingEmptyLines();
  
          switch (root.type)
          {
          case RULER:
              this.config.decorator.horizontalRuler(out);
              return;
          case NONE:
          case XML:
              break;
          case HEADLINE:
              this.config.decorator.openHeadline(out, root.hlDepth);
              if (this.useExtensions && root.id != null)
              {
                  out.append(" id=\"");
                  Utils.appendCode(out, root.id, 0, root.id.length());
                  out.append('"');
              }
              out.append('>');
              break;
          case PARAGRAPH:
              this.config.decorator.openParagraph(out);
              break;
          case CODE:
          case FENCED_CODE:
              if (this.config.codeBlockEmitter == null)
              {
                  this.config.decorator.openCodeBlock(out);
              }
              break;
          case BLOCKQUOTE:
              this.config.decorator.openBlockquote(out);
              break;
          case UNORDERED_LIST:
              this.config.decorator.openUnorderedList(out);
              break;
          case ORDERED_LIST:
              this.config.decorator.openOrderedList(out);
              break;
          case LIST_ITEM:
              this.config.decorator.openListItem(out);
              if (this.useExtensions && root.id != null)
              {
                  out.append(" id=\"");
                  Utils.appendCode(out, root.id, 0, root.id.length());
                  out.append('"');
              }
              out.append('>');
              break;
          }
  
          if (root.hasLines())
          {
              this.emitLines(out, root);
          }
          else
          {
              Block block = root.blocks;
              while (block != null)
              {
                  this.emit(out, block);
                  block = block.next;
              }
          }
  
          switch (root.type)
          {
          case RULER:
          case NONE:
          case XML:
              break;
          case HEADLINE:
              this.config.decorator.closeHeadline(out, root.hlDepth);
              break;
          case PARAGRAPH:
              this.config.decorator.closeParagraph(out);
              break;
          case CODE:
          case FENCED_CODE:
              if (this.config.codeBlockEmitter == null)
              {
                  this.config.decorator.closeCodeBlock(out);
              }
              break;
          case BLOCKQUOTE:
              this.config.decorator.closeBlockquote(out);
              break;
          case UNORDERED_LIST:
              this.config.decorator.closeUnorderedList(out);
              break;
          case ORDERED_LIST:
              this.config.decorator.closeOrderedList(out);
              break;
          case LIST_ITEM:
              this.config.decorator.closeListItem(out);
              break;
          }
      }