Closed Atreyagaurav closed 10 months ago
I am not really maintaining or using this crate anymore. If you supply a PR I will merge and publish it though.
Thank you for the response. For now, I found this one https://github.com/rloic/pandoc which seems to work with the current pandoc version. Although it doesn't have the variety on the data types that yours has.
The following patch seems to adequately implement support for Figure AST element:
Description: implement support for Figure introduced in Pandoc API 1.23
Author: Jonas Smedegaard <dr@jones.dk>
Last-Update: 2023-12-29
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -97,6 +97,8 @@
/// Definition list Each list item is a pair consisting of a term (a list of inlines)
/// and one or more definitions (each a list of blocks)
DefinitionList(Vec<(Vec<Inline>, Vec<Vec<Block>>)>),
+ /// Figure, with attributes, caption, list of blocks
+ Figure(Attr, Caption, Vec<Block>),
/// Header - level (integer) and text (inlines)
Header(Int, Attr, Vec<Inline>),
HorizontalRule,
--- a/src/visitor.rs
+++ b/src/visitor.rs
@@ -80,6 +80,18 @@
}
}
}
+ Figure(ref mut attr, ref mut caption, ref mut vec_block) => {
+ self.visit_attr(attr);
+ {
+ let (short, caption) = caption;
+ if let Some(shortcaption) = short {
+ self.visit_vec_inline(shortcaption);
+ }
+
+ self.visit_vec_block(caption);
+ }
+ self.visit_vec_block(vec_block);
+ }
Header(_, ref mut attr, ref mut vec_inline) => {
self.visit_attr(attr);
self.visit_vec_inline(vec_inline);
I got the above error, I think it has to be updated for the latest version.