From 15a63a21c974d41ea35d1f045b1c60fa8de508e5 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 3 Dec 2024 04:11:44 +0200 Subject: [PATCH] replace find_syntax_by_extension with find_syntax_by_token --- .../tab/item/page/content/text/gemini/reader/syntax.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/browser/window/tab/item/page/content/text/gemini/reader/syntax.rs b/src/app/browser/window/tab/item/page/content/text/gemini/reader/syntax.rs index ec4b798d..2e9c3444 100644 --- a/src/app/browser/window/tab/item/page/content/text/gemini/reader/syntax.rs +++ b/src/app/browser/window/tab/item/page/content/text/gemini/reader/syntax.rs @@ -32,12 +32,12 @@ impl Syntax { source_tag: &TextTag, alt: Option<&String>, ) -> Result, Error> { - if let Some(name) = alt { - if let Some(reference) = self.syntax_set.find_syntax_by_name(name) { + if let Some(value) = alt { + if let Some(reference) = self.syntax_set.find_syntax_by_name(value) { return self.syntect_buffer(source_code, source_tag, reference); } - if let Some(reference) = self.syntax_set.find_syntax_by_extension(name) { + if let Some(reference) = self.syntax_set.find_syntax_by_token(value) { return self.syntect_buffer(source_code, source_tag, reference); } }