Skip to content

typst:no-figure not working as expected #10815

@NiklasEi

Description

@NiklasEi

Using pandoc 3.6.4 on Ubuntu, I ran pandoc -f html -t typst --lua-filter ./filter.lua input.html

Where:
filter.lua

function Table(table)
  -- not sure here if an empty string is the right value?
  table.attributes['typst:no-figure'] = ""
  return table
end

input.html

<table style="min-width: 75px">
    <colgroup>
        <col style="min-width: 25px" />
        <col style="min-width: 25px" />
        <col style="min-width: 25px" />
    </colgroup>
    <tbody>
        <tr>
            <td colspan="1" rowspan="1">
                <p style="text-align: left">Test&nbsp;</p>
                <p style="text-align: left">Neue Zeile&nbsp;</p>
            </td>
            <td colspan="1" rowspan="1"><p style="text-align: center">Mitte&nbsp;</p></td>
            <td colspan="1" rowspan="1">
                <p style="text-align: right">Rechts&nbsp;</p>
                <p style="text-align: right">&nbsp;</p>
                <p style="text-align: right">Hallo&nbsp;</p>
            </td>
        </tr>
    </tbody>
</table>

I would have expected that the generate Typst table is not inside a figure, but it is. The no-figure property is added to the table in Typst instead:

#figure(
  align(center)[#table(
    columns: 3,
    align: (auto,auto,auto,),
    no-figure: ,
    [Test~

    Neue Zeile~

    ], [Mitte~

    ], [Rechts~

    ~

    Hallo~

    ],
  )]
  , kind: table
  )

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions