mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
feat(cli/fmt): support more markdown extensions (#12195)
This commit is contained in:
parent
e0c858fa27
commit
c5442abc23
4 changed files with 42 additions and 4 deletions
|
@ -206,7 +206,10 @@ pub fn format_file(
|
|||
fmt_options: FmtOptionsConfig,
|
||||
) -> Result<String, String> {
|
||||
let ext = get_extension(file_path).unwrap_or_else(String::new);
|
||||
if ext == "md" {
|
||||
if matches!(
|
||||
ext.as_str(),
|
||||
"md" | "mkd" | "mkdn" | "mdwn" | "mdown" | "markdown"
|
||||
) {
|
||||
format_markdown(file_text, &fmt_options)
|
||||
} else if matches!(ext.as_str(), "json" | "jsonc") {
|
||||
format_json(file_text, &fmt_options)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue