diff --git a/src/format_text.rs b/src/format_text.rs
index 3b540bd4..17127352 100644
--- a/src/format_text.rs
+++ b/src/format_text.rs
@@ -159,8 +159,8 @@ mod test {
extension: None,
text: "const content = html`
broken html`".into(),
config: &config,
- external_formatter: Some(&|media_type, _text, _config| {
- assert!(matches!(media_type, deno_ast::MediaType::Html));
+ external_formatter: Some(&|lang, _text, _config| {
+ assert!(matches!(lang, "html"));
Err(anyhow::anyhow!("Syntax error from external formatter"))
}),
});
diff --git a/src/generation/context.rs b/src/generation/context.rs
index 9a15b9d7..13b23f7f 100644
--- a/src/generation/context.rs
+++ b/src/generation/context.rs
@@ -18,9 +18,10 @@ use super::*;
use crate::configuration::*;
use crate::utils::Stack;
-/// A callback that will be called when encountering certain tagged templates.
+/// A callback that will be called when encountering tagged templates.
///
-/// Currently supports `css`, `html` and `sql` tagged templated.
+/// It is up to the caller to decide if a certain tagged template should be formatted
+/// by the external formatter.
///
/// Examples:
/// ```ignore
@@ -41,11 +42,11 @@ use crate::utils::Stack;
/// active IS TRUE;
/// ```
///
-/// External formatter should return `None` if it doesn't understand given `MediaType`, in such
+/// External formatter should return `None` if it doesn't understand given language, in such
/// cases the templates will be left as they are.
///
/// Only templates with no interpolation are supported.
-pub type ExternalFormatter = dyn Fn(MediaType, String, &Configuration) -> anyhow::Result