-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DocBook reader ignores the id
attribute of informalequation
#8664
Comments
Related to #8666. |
I am the user that reported #8666, it's an interesting coincidence that I encountered an very similar problem at the same time 😃. Looking at the DocBook reader code it seems that the For the case of diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs
index e11da4253..d5d468f92 100644
--- a/src/Text/Pandoc/Readers/DocBook.hs
+++ b/src/Text/Pandoc/Readers/DocBook.hs
@@ -878,7 +878,8 @@ parseBlock (Elem e) =
"bibliomisc" -> parseMixed para (elContent e)
"bibliomixed" -> parseMixed para (elContent e)
"equation" -> para <$> equation e displayMath
- "informalequation" -> para <$> equation e displayMath
+ "informalequation" -> divWith (attrValue "id" e,["informalequation"],[]) .
+ para <$> equation e displayMath
"glosssee" -> para . (\ils -> text "See " <> ils <> str ".")
<$> getInlines e
"glossseealso" -> para . (\ils -> text "See also " <> ils <> str ".") With this change the resulting AST for the DocBook code provided by @snwnde in the first message when executing [ Div
( "eq-massenergy" , [ "informalequation" ] , [] )
[ Para [ Math DisplayMath "E = mc^2" ] ]
, Para
[ Str "Let\8217s"
, Space
, Str "refer"
, Space
, Str "to"
, Space
, Link
( "" , [] , [] )
[ Str "the" , Space , Str "equation" ]
( "#eq-massenergy" , "" )
, Str "."
]
] |
Explain the problem.
DocBook reader ignores the
id
attribute ofinformalequation
. This attribute is useful for crossref, and the equivalent attribute ofsection
is very well preserved. It is thus expected that forinformalequation
this attribute also passes to AST.Here is an example DocBook input,
and the output AST,
returned by
pandoc -s -t native -f docbook example.xml
.Pandoc version?
v3.1 (https://pandoc.org/try/)
The text was updated successfully, but these errors were encountered: