aboutsummaryrefslogtreecommitdiff
path: root/test/command/1629.md
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-04-29 11:05:44 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-04-29 11:05:44 +0200
commit730796ee314d42477fab216621b8e44539c94656 (patch)
tree023418122afdff27f4595d3edb070f3d9f11db88 /test/command/1629.md
parente76b6724144032c62c183f850fe05271aa245fb5 (diff)
downloadpandoc-730796ee314d42477fab216621b8e44539c94656.tar.gz
LaTeX writer: Fix problem with escaping in lstinline.
Previously the LaTeX writer created invalid LaTeX when `--listings` was specified and a code span occured inside emphasis or another construction. This is because the characters `%{}\` must be escaped in lstinline when the listinline occurs in another command, otherwise they must not be escaped. To deal with this, adoping Michael Kofler's suggestion, we always wrap lstinline in a dummy command `\passthrough`, now defined in the default template if `--listings` is specified. This way we can consistently escape the special characters. Closes #1629.
Diffstat (limited to 'test/command/1629.md')
-rw-r--r--test/command/1629.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/command/1629.md b/test/command/1629.md
new file mode 100644
index 000000000..34d529b0d
--- /dev/null
+++ b/test/command/1629.md
@@ -0,0 +1,10 @@
+```
+% pandoc -t latex --listings
+bla bla `a % b`
+
+*bla bla `a % b`*
+^D
+bla bla \passthrough{\lstinline!a \% b!}
+
+\emph{bla bla \passthrough{\lstinline!a \% b!}}
+```