Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MediaWiki comments destroy Tables in Parser #8110

Closed
elijahpettitt opened this issue Jun 6, 2022 · 0 comments
Closed

MediaWiki comments destroy Tables in Parser #8110

elijahpettitt opened this issue Jun 6, 2022 · 0 comments
Labels

Comments

@elijahpettitt
Copy link

MediaWiki Comments
When comments <!-- A Comment--> are placed on the same line as a new row symbol |- the |- is parsed as another cell and no other cells or rows are parsed.

When the comment is on a separate line(or on the next cell line) after the row mark and before another cell mark | pandoc throws the error:
Error at "source.wiki" (line 13, column 2): unexpected ' ' | Example
with an arrow pointing at the space bewteen "|" and "Example"

There are no errors when the comment is in a cell on the same line or on its own line

Command Line
(docker run --rm --mount type=bind,source="$(pwd)"/pandoc,target=/data --user "$(id -u)":"$(id -g)" pandoc/core:latest source.wiki -f mediawiki -t html) > pandoc/target.html

Input1 failed example

{| class="wikitable"
! Header text 
! Header text 
! Header text

|-
| Example 
| Example 
| Example

|- <!-- This is a comment --> 
| Example 
| Example 
| Example
|}

Output1

<table>
<thead>
<tr class="header">
<th><p>Header text</p></th>
<th><p>Header text</p></th>
<th><p>Header text</p></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><p>Example</p></td>
<td><p>Example</p></td>
<td><p>Example</p>
<p>|-</p></td>
</tr>
</tbody>
</table>

Expected1

<table>
<thead>
<tr class="header">
<th><p>Header text</p></th>
<th><p>Header text</p></th>
<th><p>Header text</p></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><p>Example</p></td>
<td><p>Example</p></td>
<td><p>Example</p></td>
</tr>
<tr class="even">
<td><p>Example</p></td>
<td><p>Example</p></td>
<td><p>Example</p></td>
</tr>
</tbody>
</table>

Version
I am running on Ubuntu but using docker

pandoc 2.18
Compiled with pandoc-types 1.22.2, texmath 0.12.5, skylighting 0.12.3,
citeproc 0.7, ipynb 0.2, hslua 2.1.0
Scripting engine: Lua 5.3
User data directory: /root/.local/share/pandoc
@jgm jgm closed this as completed in f637ccd Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant