Module talk:Check DYK hook
Appearance
Script error
@Frietjes and Mr. Stradivarius:
This [1] apparently 'fixed' some script errors, but broke the checks. At least, for entries ending with {{-?}}
and made Category:Pages with a malformed DYK entry balloon to 160+ 'malformed' entries, which were perfectly well-formed. Headbomb {t · c · p · b} 15:17, 27 November 2020 (UTC)
- It's possible that it did fix the script, but that the check itself didn't handle those entries. But this is LUA, so I can't diagnose anything here much. Headbomb {t · c · p · b} 15:18, 27 November 2020 (UTC)
- Headbomb, yes, before the fix those 160+ entries were in Category:Pages with script errors instead. I think the regular expression requires some changes you may be able to test it with
Live
"{{#invoke:Check DYK hook|isValidHook|1=... that director and screenwriter Travis Stevens paused renovations on his production company's house to film '''''[[Girl on the Third Floor]]'''''?}}"
= "yes""{{#invoke:Check DYK hook|isValidHook|1=... that director and screenwriter Travis Stevens paused renovations on his production company's house to film '''''[[Girl on the Third Floor]]'''''{{-?}}}"
= "yes"
Sandbox
"{{#invoke:Check DYK hook/sandbox|isValidHook|1=... that director and screenwriter Travis Stevens paused renovations on his production company's house to film '''''[[Girl on the Third Floor]]'''''?}}"
= "yes""{{#invoke:Check DYK hook/sandbox|isValidHook|1=... that director and screenwriter Travis Stevens paused renovations on his production company's house to film '''''[[Girl on the Third Floor]]'''''{{-?}}}}"
= "yes"
- not sure why we are getting a script error for the live template even with the
|1=
. Frietjes (talk) 15:26, 27 November 2020 (UTC)- Headbomb, it looks like the "match" used for whitespace cleaning was returning "nil" in those cases but changing it to a mw.ustring.gsub (see here) fixed it. or at least fixed it so both cases are showing valid and no script errors. Frietjes (talk) 15:42, 27 November 2020 (UTC)