Use configured extension mapping to select code block language (#22934)
- Adds `Language::get_extension` to look up extension mappings without a
`Path` object
- Adds logic to `format_code_blocks` to obey any configured extension
mapping when determining the source type of a code block
- Adds test case showing formatting a `py` code block as if it was `pyi`
by using the configured extension map
This will allow ty run ruff formatting on md test files while
force-mapping `py` blocks to `pyi` for condensed formatting results.
Issue #22639