siddharthvp/mwn

Wikitext.parseTemplates doesn't handle links in image titles

Opened this issue · 0 comments

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