Skip to content

Divs contain unnecessary blank lines in Mediawiki output #11417

@rohieb

Description

@rohieb

Using pandoc 3.8.3:

$ cat test.markdown
Some plain text

::: {.some-class}
Here is a div
:::

Here is some more plain text
$ pandoc-3.8 -t mediawiki test.markdown 
Some plain text
<div class="some-class">

Here is a div


</div>
Here is some more plain text

The output for the div snippet contains one additional blank line after the opening <div>, two additional blank lines before the closing </div>, and no blank line after the closing </div> (even though the Markdown input contained blank lines before and after the div element). While two of those are rather cosmetic, the double blank line inside the div makes MediaWiki generate an additional empty paragraph in the rendered output:

Image

It would be great (also for readability) if the MediaWiki writer could generate this instead, which MediaWiki renders more true to the original Markdown input:

Some plain text

<div class="some-class">
Here is a div
</div>

Here is some more plain text
Image

Version Info:

$ pandoc-3.8 --version
pandoc 3.8.3
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: ${HOME}/.local/share/pandoc
Copyright (C) 2006-2025 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.

Pandoc downloaded from GitHub releases, and running on Debian testing/unstable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions