make highlight function public

This commit is contained in:
yggverse 2024-12-02 23:02:12 +02:00
parent a0af227e28
commit ac1b896fc0

View File

@ -35,7 +35,11 @@ impl Syntax {
Ok(source.to_string())
}
fn highlight(&self, source: &str, syntax_reference: &SyntaxReference) -> Result<String, Error> {
pub fn highlight(
&self,
source: &str,
syntax_reference: &SyntaxReference,
) -> Result<String, Error> {
let ranges = HighlightLines::new(syntax_reference, &self.theme_set.themes[DEFAULT_THEME])
.highlight_line(&source, &self.syntax_set)?;