diff options
author | Satya Rohith <me@satyarohith.com> | 2021-09-23 21:49:25 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-23 21:49:25 +0530 |
commit | c5442abc237b8e11491afb09dbaa80a66488fc7b (patch) | |
tree | 319a2df2095008a32bc9847c542bf1b96053473f /cli/tools/fmt.rs | |
parent | e0c858fa27af07f163f5d18bb0401d0f0069dd3c (diff) |
feat(cli/fmt): support more markdown extensions (#12195)
Diffstat (limited to 'cli/tools/fmt.rs')
-rw-r--r-- | cli/tools/fmt.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index 6758d7b8b..5d33240a5 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -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) |