From fe9c859f7fc8306cebec980fa410affd1452d089 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 3 Dec 2024 04:16:37 +0200 Subject: [PATCH] add find_syntax_by_path method in order --- .../window/tab/item/page/content/text/gemini/reader/syntax.rs | 4 ++++ 1 file changed, 4 insertions(+) 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 2e9c3444..bee60311 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 @@ -40,6 +40,10 @@ impl Syntax { if let Some(reference) = self.syntax_set.find_syntax_by_token(value) { return self.syntect_buffer(source_code, source_tag, reference); } + + if let Some(reference) = self.syntax_set.find_syntax_by_path(value) { + return self.syntect_buffer(source_code, source_tag, reference); + } } if let Some(reference) = self.syntax_set.find_syntax_by_first_line(source_code) {