summaryrefslogtreecommitdiff
path: root/src/syntax/highlight.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-10-17 19:26:24 +0200
committerLaurenz <laurmaedje@gmail.com>2022-10-17 20:04:22 +0200
commite21822665591dc19766275da1e185215a6b945ef (patch)
tree7788e211c3c33c8b5a8ad7d5eb7574e33631eb16 /src/syntax/highlight.rs
parent4fd031a256b2ecfe524859d5599fafb386395572 (diff)
Merge some modules
Diffstat (limited to 'src/syntax/highlight.rs')
-rw-r--r--src/syntax/highlight.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/syntax/highlight.rs b/src/syntax/highlight.rs
index bfb36078..325b7274 100644
--- a/src/syntax/highlight.rs
+++ b/src/syntax/highlight.rs
@@ -6,7 +6,7 @@ use std::ops::Range;
use syntect::highlighting::{Color, FontStyle, Highlighter, Style, Theme};
use syntect::parsing::Scope;
-use super::{NodeKind, SyntaxNode};
+use super::{parse, NodeKind, SyntaxNode};
/// Highlight source text into a standalone HTML document.
pub fn highlight_html(text: &str, theme: &Theme) -> String {
@@ -28,7 +28,7 @@ pub fn highlight_pre(text: &str, theme: &Theme) -> String {
let mut buf = String::new();
buf.push_str("<pre>\n");
- let root = crate::parse::parse(text);
+ let root = parse(text);
highlight_themed(&root, theme, |range, style| {
let styled = style != Style::default();
if styled {
@@ -401,8 +401,8 @@ impl Category {
#[cfg(test)]
mod tests {
+ use super::super::Source;
use super::*;
- use crate::source::Source;
#[test]
fn test_highlighting() {