mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
fix(oxfmt): load svelte plugin for svelte-in-mdx-in-md (#27369)
Rare trigger, but for consistency. `````` `````md ## MDX ````mdx ### Svelte ```svelte <script> // HERE gets formatted </script> ``` ````
This commit is contained in:
1 parent
984b63957e
commit
db360defa4
1 file changed
+4
-1
@@ -281,7 +281,10 @@ impl ResolvedDispatchConfig {
|
||||
|
||||
let mut options = self.prettier_options().clone();
|
||||
crate::core::options::inject_parser(&mut options, language.parser());
|
||||
if matches!(language, PrettierLanguage::Svelte) {
|
||||
// Embedded parts only (whole files go through `format_by_prettier`):
|
||||
// - svelte-in-md: a ```svelte code block
|
||||
// - svelte-in-mdx-in-md: `mdx` allows ```svelte code blocks
|
||||
if matches!(language, PrettierLanguage::Svelte | PrettierLanguage::Mdx) {
|
||||
crate::core::options::inject_svelte_plugin_payload(&mut options, &self.config);
|
||||
}
|
||||
Some(options)
|
||||
|
||||
Reference in new issue
Block a user