aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTuongNM <[email protected]>2025-09-15 10:28:57 +0200
committerGitHub <[email protected]>2025-09-15 10:28:57 +0200
commite2f088f4e5ea1543757b064b3871b483109bda42 (patch)
treea5c2f93c9986355538ef66624938df9678190afd /test
parent4be17f77b77815c32ab9ffbae6ece72cc1e36221 (diff)
LaTeX writer: Protect VERB in caption (#11139)
Also apply hlint suggestions for fewer imports and moving brackets to avoid $.
Diffstat (limited to 'test')
-rw-r--r--test/command/6821.md80
1 files changed, 80 insertions, 0 deletions
diff --git a/test/command/6821.md b/test/command/6821.md
new file mode 100644
index 000000000..c38953248
--- /dev/null
+++ b/test/command/6821.md
@@ -0,0 +1,80 @@
+```
+% pandoc -f native -t latex
+[ Para [ Code ( "" , [ "python" ] , [] ) "x = 5" ]
+, Figure
+ ( "" , [] , [] )
+ (Caption
+ Nothing
+ [ Plain
+ [ Str "This"
+ , Space
+ , Str "is"
+ , Space
+ , Str "a"
+ , Space
+ , Str "test"
+ , Space
+ , Code ( "" , [ "python" ] , [] ) "x = 5"
+ ]
+ ])
+ [ Plain
+ [ Image
+ ( "" , [] , [] )
+ [ Str "This"
+ , Space
+ , Str "is"
+ , Space
+ , Str "a"
+ , Space
+ , Str "test"
+ , Space
+ , Code ( "" , [ "python" ] , [] ) "x = 5"
+ ]
+ ( "test.png" , "" )
+ ]
+ ]
+, Table
+ ( "" , [] , [] )
+ (Caption
+ Nothing
+ [ Plain [ Code ( "" , [ "cpp" ] , [] ) "caption" ] ])
+ [ ( AlignDefault , ColWidthDefault ) ]
+ (TableHead ( "" , [] , [] ) [])
+ [ TableBody ( "" , [] , [] ) (RowHeadColumns 0) [] [] ]
+ (TableFoot
+ ( "" , [] , [] )
+ [ Row
+ ( "" , [] , [] )
+ [ Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "A" ] ]
+ ]
+ ])
+, Para [ Code ( "" , [ "cpp" ] , [] ) "caption" ]
+]
+^D
+\VERB|\NormalTok{x }\OperatorTok{=} \DecValTok{5}|
+
+\begin{figure}
+\centering
+\pandocbounded{\includegraphics[keepaspectratio,alt={This is a test x = 5}]{test.png}}
+\caption{This is a test
+\protect\VERB|\NormalTok{x }\OperatorTok{=} \DecValTok{5}|}
+\end{figure}
+
+\begin{longtable}[]{@{}l@{}}
+\caption{\protect\VERB|\NormalTok{caption}|}\tabularnewline
+\toprule\noalign{}
+\endfirsthead
+\endhead
+\midrule\noalign{}
+A \\
+\bottomrule\noalign{}
+\endlastfoot
+\end{longtable}
+
+\VERB|\NormalTok{caption}|
+```