From c2d6fa0bd932a288dbac576772c4bfdc68a36b60 Mon Sep 17 00:00:00 2001 From: Shadaj Laddad Date: Wed, 4 Dec 2024 11:48:22 -0800 Subject: [PATCH] fix(docs): syntax highlight variations of Rust language tag (#1593) --- docs/src/theme/prism-include-languages.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/src/theme/prism-include-languages.js b/docs/src/theme/prism-include-languages.js index c8fe35db80e1..60c669870207 100644 --- a/docs/src/theme/prism-include-languages.js +++ b/docs/src/theme/prism-include-languages.js @@ -12,10 +12,11 @@ export default function prismIncludeLanguages(PrismObject) { require(`prismjs/components/prism-${lang}`); }); Prism.languages["rust,ignore"] = Prism.languages.rust; + Prism.languages["rust,no_run"] = Prism.languages.rust; const origTokenize = PrismObject.tokenize; PrismObject.hooks.add("after-tokenize", function(env) { - if (env.language === "rust") { + if (env.language === "rust" || env.language === "rust,ignore" || env.language === "rust,no_run") { let code = env.code.split("\n").filter(line => !line.startsWith("# ")).join("\n"); env.tokens = origTokenize(code, env.grammar); }