Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/main/java/org/pegdown/DefaultVerbatimSerializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@
public class DefaultVerbatimSerializer implements VerbatimSerializer {
public static final DefaultVerbatimSerializer INSTANCE = new DefaultVerbatimSerializer();

private final String classPrefix;

public DefaultVerbatimSerializer() {
this("");
}

public DefaultVerbatimSerializer(final String classPrefix) {
this.classPrefix = classPrefix;
}

@Override
public void serialize(final VerbatimNode node, final Printer printer) {
printer.println().print("<pre><code");
if (!StringUtils.isEmpty(node.getType())) {
printAttribute(printer, "class", node.getType());
printAttribute(printer, "class", this.classPrefix+node.getType());
}
printer.print(">");
String text = node.getText();
Expand Down