Skip to content

Wikitext.parseTemplates doesn't handle links in image titles #85

@JN-Jones

Description

@JN-Jones

Hi,

I've a template which in one parameter has an image and that image has a link in its title. However using parseTemplates this link in the image seems to break the parser.

Example:

    const text = `{{Template
|Param=
[[Datei:img.png|thumb|Some [[aricle|title]]|right|200px]]
Remaining Text
}}`;
    const wt = new bot.Wikitext(text);
    const [template] = wt.parseTemplates({});
    console.log(template.getValue('Param'));

Logs [[Datei:img.png|thumb|Some [[aricle|title]] instead of [[Datei:img.png|thumb|Some [[aricle|title]]|right|200px]]\nRemaining Text

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions