Fixing WikiReader's Silently Broken Wikipedia Transclusions
Today I forked WikiReader to fix two rendering bugs where Wikipedia content was being silently discarded. No crash, no error, the table just vanished, which sucked.
The Problem
Wikipedia articles lean heavily on wikitext features that go beyond plain templates, and WikiReader's parser wasn't handling two of them correctly.
Section transclusions ({{#section:Page|Section}}) pull in a specific section from another page rather than the whole thing.
This explained why I could view upcoming MCU movies in a list but not previous :)
WikiReader wasn't resolving these at all, so any article using them ended up with a gap where that content should have been.
Numbered template parameters (|1=Example) are a common way to pass positional arguments explicitly inside link and template syntax. WikiReader was treating the 1= prefix as literal text rather than stripping it before rendering, so instead of the actual value you'd see the raw parameter syntax leaking into the article.
The Fix
Section transclusions are now expanded properly: the fork fetches the referenced page, extracts the specified section, and drops it into place. Any leftover transclusion markers get stripped during cleanup so nothing stray is left behind in the rendered output.
Numbered parameters in link and template arguments are now handled correctly too. The N= prefix is stripped before rendering, so the actual value shows up instead of the parameter syntax itself.
Both fixes are covered by new unit tests, so they should stay fixed.
Fork It, Spread the Love
As per the README: pull requests are not welcome, and I promise that's not meant to be rude, I just have better things to do with my time. If you like the project, fork it and spread the love. And if you really like it, feel free to donate.
Repo: github.com/MANICX100/WikiReader-fork
Peace ✌️