Blog talk:Adnoam/Updates to Template:Item/@comment-25219384-20200823114738

From Fallen London Wiki

I've run into an annoying implementation issue:

Item pages pass the effects to the {{Item}} template as:

|Effects1 = {{IL|Watchful}} +4

And all templates parameters are passed to a Lua Module being invoked. *However*, wikitext is expanded the minute the Lua Module code tries to read it. So in fact, what the module's code sees as the argument's value is:

[[File:Owl.png|20px|link=Watchful]] [[Watchful]] +4

I can easily write a regular expression to match this and extract from this pattern the quality's name and value, but it's ugly, and makes the module's code dependent on the exact implementation details of the {{IL}} template and module.

Does anyone with Scribunto experience have any better ideas?