Page MenuHomePhabricator

mw.html:wikitext doesn't set expected value
Closed, DuplicatePublic

Description

How to reproduce (on enwiki):
Assumption - Relevant code from en:Module:Infobox

local function renderTitle()
    if not args.title then return end

    root
        :tag('caption')
            :addClass(args.titleclass)
            :cssText(args.titlestyle)
            :wikitext(args.title)
end

Now given the input:

{{Infobox|title=Wiki [[File:Wiki.png|left]]}}

We expect an infobox table with caption

Wiki <div class="floatright"><a href="/wiki/File:Wiki.png" class="image"><img alt="Wiki.png" src="//upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png" data-file-width="135" data-file-height="155" width="135" height="155"></a></div>

Actual
A table with caption

Wiki

and the div is outside the caption/table element.