Skip to content

The wiki media template deserializer needs improvements #29

@soul4soul

Description

@soul4soul

Overall the parser is okay, it's able to parse 1664 of the 1666 monsters listed on tibia wiki. Still, there are multiple issues with the deserializer logic that needs to be fixed. Here are all the known issues using the template parser with tibiawiki. Ideally the deserializer would be able to support any wiki media template. It'd be smart to look at the code wikimedia uses themselves for reference.

  1. When there is a param like |look_direction=| this will incorrectly set the field as that value instead of skipping the field or setting the value as an empty string. The reg expression used seems to work on regexr but not in c#
  2. When parameter names are used out of order before parameters which come earlier the parser gets confused. An example is an ability from "Bloom of Doom"Fixed in [TW][output] Improvements to ability output and more #79
    • "Value cannot be null. (Parameter 'input')" -- parsing ability "{{melee|name=melee (random interval)|9600+}}"
      • The problem is name is normally the 3rd param but it's set first here, then the damage is next which default to index 0 since it's first unnamed param
  3. Extra data at the start or end of a template has the potential to cause the parse to fail when the extra data has templates itself. Two examples are "Ascending_Ferumbras" and "Destabilized Ferumbras"
    • Extra text at end of creature template that is inside noinclude html tags. Inside the tags is more templates {{}} which we don't want to match.
  4. Files names used in galleries or on the page could include bracing symbols. An example is "Crystal Wolf"
    • One of the file names in the gallery includes "=)" to make a smiley face
  5. Nearly the same as 4, galleries use the | symbol to separate the file name with an optional image description. An example is "crystal wolf", "Deathling scout", and "yakchal"
  6. Templates with "arrays" aren't parsed correctly when the parameters are named.
    • The example is parsing mimic outfit templates
  7. BONUS: Parser should support parsing into basic value types in addition to the string type
  8. BONUS: Parser should support parsing of nested template when the target property is attributed as a template

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions