Interface BlockEmitter

All Known Implementing Classes:
CodeBlockEmitter

public interface BlockEmitter
Block emitter interface. An example for a code block emitter is given below:
 public void emitBlock(StringBuilder out, List<String> lines, String meta)
 {
     out.append("<pre><code>");
     for(final String s : lines)
     {
         for(int i = 0; i < s.length(); i++)
         {
             final char c = s.charAt(i);
             switch(c)
             {
             case '&':
                 out.append("&amp;");
                 break;
             case '<':
                 out.append("&lt;");
                 break;
             case '>':
                 out.append("&gt;");
                 break;
             default:
                 out.append(c);
                 break;
             }
         }
         out.append('\n');
     }
     out.append("</code></pre>\n");
 }
 
 
Since:
0.7
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    emitBlock(StringBuilder out, List<String> lines, String meta)
    This method is responsible for outputting a markdown block and for any needed pre-processing like escaping HTML special characters.
  • Method Details

    • emitBlock

      void emitBlock(StringBuilder out, List<String> lines, String meta)
      This method is responsible for outputting a markdown block and for any needed pre-processing like escaping HTML special characters.
      Parameters:
      out - The StringBuilder to append to
      lines - List of lines
      meta - Meta information as a single String (if any) or empty String