[FIX] Textlib: Expand category if necessary

If the category name contains a template, it needs to be expanded.
The regex now only fails if there are ]] within template parameters
like '[[Category:{{P2|]]muhahahaha|legit}}]]'.

Change-Id: I1cbc1a3865f93c07909056e1f24af8bd333d5f34
Merge "[FIX] Textlib: Expand category if necessary"