Update detect() functions to sync with WikiRenderer.