Skip to content

'ansi' output format can fail to format code #11775

Description

@phormio

I have a file named test1.md:

<div>

| Blah | Blah | Blah | Blah |
| --- | --- | --- | --- |
| `title` | Y | String | HTML title. |
| `output_directory` | Y | String | Directory that contains blah blah blah. |

| a | b |
| --- | --- |
| `c` | `d` |
| `e_x` | `f` |

</div>

Using pandoc 3.10.1 on Linux, I ran this command

pandoc -t ansi test1.md

In the output, output_directory was formatted differently from all the other words that are in backquotes. It was formatted just like "String".

Another strange thing is that output_directory was one line lower than I would expect.

pandoc does know that output_directory is code. I proved that by running this command:

pandoc -t xml test1.md | xmllint --format - | grep -2 output_directory

Here is the output:

              <Cell alignment="AlignDefault">
                <Plain>
                  <Code>output_directory</Code>
                </Plain>
              </Cell>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions