Skip to content

DocBook reader ignores the id attribute of informalequation #8664

Closed
@snwnde

Description

@snwnde

Explain the problem.

DocBook reader ignores the id attribute of informalequation. This attribute is useful for crossref, and the equivalent attribute of section is very well preserved. It is thus expected that for informalequation this attribute also passes to AST.

Here is an example DocBook input,

<?xml version="1.0" encoding="UTF-8"?>
<?asciidoc-toc?>
<?asciidoc-numbered?>
<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en">
<info>
<title>Example</title>
<date>2023-03-03</date>
</info>
<informalequation xml:id="eq-massenergy">
<alt><![CDATA[E = mc^2]]></alt>
<mathphrase><![CDATA[E = mc^2]]></mathphrase>
</informalequation>
<simpara>Let&#8217;s refer to <link linkend="eq-massenergy">the equation</link>.</simpara>
</article>

and the output AST,

Pandoc
  Meta
    { unMeta =
        fromList
          [ ( "date" , MetaInlines [ Str "2023-03-03" ] )
          , ( "title" , MetaInlines [ Str "Example" ] )
          ]
    }
  [ 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 "."
      ]
  ]

returned by pandoc -s -t native -f docbook example.xml.

Pandoc version?
v3.1 (https://pandoc.org/try/)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions