panda.doc.markdown.html.CodeBlockEmitter Maven / Gradle / Ivy
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);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy