panda.doc.markdown.html.CodeBlockEmitter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of panda-core Show documentation
Show all versions of panda-core Show documentation
Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.
package panda.doc.markdown.html;
import java.io.IOException;
import java.util.List;
import panda.doc.markdown.BlockEmitter;
import panda.lang.Exceptions;
import panda.lang.StringEscapes;
public class CodeBlockEmitter implements BlockEmitter {
@Override
public void emitBlock(StringBuilder out, List lines, String meta) {
try {
out.append(" 0) {
out.append(" class=\"");
StringEscapes.escapeHtml(meta, out);
out.append('\"');
}
out.append('>');
for (final String s : lines) {
StringEscapes.escapeHtml(s, out);
out.append('\n');
}
out.append("
\n");
}
catch (IOException e) {
throw Exceptions.wrapThrow(e);
}
}
}