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

Nested links in mediawiki output should be removed. #8738

Open
wgevaert opened this issue Mar 30, 2023 · 0 comments
Open

Nested links in mediawiki output should be removed. #8738

wgevaert opened this issue Mar 30, 2023 · 0 comments
Labels

Comments

@wgevaert
Copy link
Contributor

wgevaert commented Mar 30, 2023

Explain the problem.
Do the following:

pandoc -i test.json -t mediawiki

where test.json contains the following (or similar):

{
    "pandoc-api-version": [
        1,
        23
    ],
    "meta": {},
    "blocks": [
        {
            "t": "Plain",
            "c": [
                {
                    "t": "Link",
                    "c": [
                        [
                            "",
                            [],
                            []
                        ],
                        [
                            {
                                "t": "Link",
                                "c": [
                                    [
                                        "",
                                        [],
                                        []
                                    ],
                                    [
                                        {
                                            "t": "Str",
                                            "c": "test"
                                        },
                                        {
                                            "t": "Strong",
                                            "c": [
                                                {
                                                    "t": "Link",
                                                    "c": [
                                                        [
                                                            "",
                                                            [],
                                                            []
                                                        ],
                                                        [
                                                            {
                                                                "t": "Str",
                                                                "c": "test"
                                                            }
                                                        ],
                                                        [
                                                            "baz",
                                                            ""
                                                        ]
                                                    ]
                                                }
                                            ]
                                        }
                                    ],
                                    [
                                        "bar",
                                        ""
                                    ]
                                ]
                            }
                        ],
                        [
                            "foo",
                            ""
                        ]
                    ]
                }
            ]
        }
    ]
}

Actual output:

[[foo|test[[bar|test'''test[[baz|test]]''']]]]

Which is displayed by MediaWiki as:
[[foo|test[[bar|testtesttest]]]]

Expected result:

Something like

[[foo|test test'''test test''']]

which MediaWiki displays as:
test testtest test

Compare this with the output of the html writer:

<a href="foo">test<span>test<strong>test<span>test</span></strong></span></a>

Which is very similar to desired Mediawiki output.

Pandoc version?

pandoc 3.0
Features: +server +lua
Scripting engine: Lua 5.4
OS: Mac
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