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 reader fails on tables when the line following a table caption starts with spaces #10390

Closed
LtdJorge opened this issue Nov 16, 2024 · 1 comment
Labels

Comments

@LtdJorge
Copy link

Explain the problem.

A minimal example that works:

 {| class="wikitable"
 |+ Overview of basic table markup
! Key
 |-
 | Value
 |}

Same minimal example that doesn't work:

 {| class="wikitable"
 |+ Overview of basic table markup
 ! Key
 |-
 | Value
 |}

Notice how every line starts with a space. The amount of spaces is irrelevant, as long as it's more than 0. If you take the caption out, it works again:

 {| class="wikitable"
 ! Key
 |-
 | Value
 |}

I guess the issue is in

table = do
tableStart
styles <- option [] $
parseAttrs <* skipMany spaceChar <* optional (char '|')
skipMany spaceChar
optional $ template >> skipMany spaceChar
optional blanklines
let tableWidth = case lookup "width" styles of
Just w -> fromMaybe 1.0 $ parseWidth w
Nothing -> 1.0
caption <- option mempty tableCaption
optional rowsep

Or in

tableCaption = try $ do
optional rowsep
guardColumnOne
skipSpaces
sym "|+"
optional (try $ parseAttrs *> skipSpaces *> char '|' *> blanklines)
trimInlines . mconcat <$>
many (notFollowedBy (void cellsep <|> rowsep) *> inline)

rowsep looks good to me, but I don't know anything about Haskell.

Pandoc version?
This happens on "Try pandoc!" as well as on my local installation.
My local pandoc, on Gentoo Linux is:

pandoc 2.18
Compiled with pandoc-types 1.22.2, texmath 0.12.5.1, skylighting 0.12.3.1,
citeproc 0.7, ipynb 0.2, hslua 2.2.0
Scripting engine: Lua 5.4
User data directory: /home/jorge/.local/share/pandoc
Copyright (C) 2006-2022 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.
@LtdJorge LtdJorge added the bug label Nov 16, 2024
@jgm jgm closed this as completed in fabfaab Nov 19, 2024
@LtdJorge
Copy link
Author

LtdJorge commented Dec 3, 2024

Thanks, John!

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