mediawiki_rust icon indicating copy to clipboard operation
mediawiki_rust copied to clipboard

Add {{nobots}} helper function

Open legoktm opened this issue 4 years ago • 2 comments

The specification is documented at https://en.wikipedia.org/wiki/Template:Bots

I'd expect a function signature of

fn bot_may_edit(wikitext: &str, bot: &str) -> bool { ... }

This probably warrants going in its own module, maybe behind a feature since it'll probably add a dependency on regex.

legoktm avatar Feb 17 '21 21:02 legoktm

Also, this would tie the crate to Wikipedia/Wikimedia, where until here it's mostly agnostic...

magnusmanske avatar Nov 15 '21 09:11 magnusmanske

I've seen it used on other wikis, it's more of a template specification than anything else. In any case, https://gitlab.com/mwbot-rs/mwbot/-/blob/master/mwbot/src/utils.rs is what I implemented using Parsoid HTML.

legoktm avatar Nov 16 '21 05:11 legoktm