Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding linesep option to pygments

  • Loading branch information...
commit 4aae9f0e8d72ebe56a3c694c44c70aff6613fcde 1 parent 2c45ea8
@csokol csokol authored
View
4 src/main/java/br/com/caelum/tubaina/parser/html/desktop/SyntaxHighlighter.java
@@ -39,6 +39,10 @@ public String highlight(String code, String language, boolean numbered, List<Int
commands.add("pygmentize");
commands.add("-O");
commands.add("encoding=" + encoding + ",outencoding=UTF-8" + options);
+ if (output.equals(LATEX_OUTPUT)) {
+ commands.add("-P");
+ commands.add("verboptions=numbersep=5pt");
+ }
commands.add("-f");
commands.add(output);
commands.add("-l");
View
2  src/test/java/br/com/caelum/tubaina/parser/html/desktop/SyntaxHighlighterTest.java
@@ -68,7 +68,7 @@ public void shouldCallPygmentsWithLatexOutput() throws Exception {
highlighter.highlight(sampleCode, "java", false);
String encoding = System.getProperty("file.encoding");
List<String> arguments = Arrays.asList("pygmentize", "-O", "encoding=" + encoding
- + ",outencoding=UTF-8", "-f", "latex", "-l", "java");
+ + ",outencoding=UTF-8", "-P", "verboptions=numbersep=5pt", "-f", "latex", "-l", "java");
verify(executor).execute(eq(arguments), eq(sampleCode));
}
Please sign in to comment.
Something went wrong with that request. Please try again.