All Downloads are FREE. Search and download functionalities are using the official Maven repository.

panda.doc.markdown.html.CodeBlockEmitter Maven / Gradle / Ivy

Go to download

Panda Core is the core module of Panda Framework, it contains commonly used utility classes similar to apache-commons.

There is a newer version: 1.8.0
Show newest version
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 - 2024 Weber Informatics LLC | Privacy Policy