From 8d93cd794955578b105e163e8a79df2bc05fc02e Mon Sep 17 00:00:00 2001 From: Nikolay Yakimov Date: Sat, 24 May 2025 21:41:45 +0400 Subject: Markdown writer: preserve figure attributes 0d2114e introduced a bug where Markdown writer would ignore attributes on the figure if it has class or key-value attributes set. This commit fixes that and adds a regression test. Closes #10867 --- test/command/10867.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/command/10867.md (limited to 'test') diff --git a/test/command/10867.md b/test/command/10867.md new file mode 100644 index 000000000..8852e1131 --- /dev/null +++ b/test/command/10867.md @@ -0,0 +1,26 @@ +``` +% pandoc -f native -t markdown-raw_html +[ Figure + ( "fig:foo" , [] , [ ( "label" , "1.1" ) ] ) + (Caption + Nothing + [ Plain + [ Str "Figure" , Space , Str "1.1:" , Space , Str "Figure" ] + ]) + [ Plain + [ Image + ( "" , [] , [] ) + [ Str "Figure" , Space , Str "1.1:" , Space , Str "Figure" ] + ( "./image.png" , "" ) + ] + ] +] +^D +:::: {#fig:foo .figure label="1.1"} +![Figure 1.1: Figure](./image.png) + +::: caption +Figure 1.1: Figure +::: +:::: +``` -- cgit v1.2.3