yes, see wiki_page.rb
:
https://github.com/danbooru/danbooru/blob/af7c40d98e537ade6a9fc3e8bdb7793977eb72dc/app/models/wiki_page.rb#L29
it performs an ID lookup if the value consists of only digits, otherwise performs a title lookup -- normalize_title
strips the ~
prefix if present, so that prefix is used to force a title lookup.