Skip to content

Table caption in DOCX attached to wrong table #9358

Closed
@rgaiacs

Description

@rgaiacs

Consider table-mwe.docx that has two tables:

Screenshot 2024-01-22 175759

Let's convert the .docx to Markdown with pandoc --from docx --to markdown+table_captions table-mwe.docx.

Observed Output

The caption is connected to the first table instead of the second table.

Lorem ipsum

  -----------------------------------------------------------------------
  A                                   B
  ----------------------------------- -----------------------------------
  C                                   D

  -----------------------------------------------------------------------

  : Numbers from 1 to 4

Lorem ipsum

  -----------------------------------------------------------------------
  1                                   2
  ----------------------------------- -----------------------------------
  3                                   4

  -----------------------------------------------------------------------

Lorem ipsum

Expected Output

Lorem ipsum

  -----------------------------------------------------------------------
  A                                   B
  ----------------------------------- -----------------------------------
  C                                   D

  -----------------------------------------------------------------------

Lorem ipsum

  -----------------------------------------------------------------------
  1                                   2
  ----------------------------------- -----------------------------------
  3                                   4

  -----------------------------------------------------------------------

  : Numbers from 1 to 4

Lorem ipsum

Environment

pandoc --version returns

pandoc 3.1.11.1
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /home/raniere/.local/share/pandoc
Copyright (C) 2006-2023 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions