mygit

[UNMAINTAINED] A cgit/webgit alternative, written in Rust
Log | Files | Refs | README | LICENSE

commit 92fb691411f904598a08986e0ab910ed4de737b7
parent 5b4d76ad88fd679abfbdb2ed07f3639d50bf48c9
Author: Johann150 <johann@qwertqwefsday.eu>
Date:   Wed, 31 Mar 2021 00:04:07 +0200

fix CSS for syntax highlighting

I forgot to change the class style back to Spaced, which is what
was used when generating the base of the style sheets from syntect.

Also the .line CSS selector interfered with some syntect items
that were also using this class. The solution is to restrict it
to links only. This made some lines, e.g. with doc comments
display wrong by having multiple line numbers on one line.

Diffstat:
Msrc/main.rs | 2+-
Mtemplates/static/style.css | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main.rs b/src/main.rs @@ -423,7 +423,7 @@ async fn repo_file(req: Request<()>) -> tide::Result { let mut highlighter = ClassedHTMLGenerator::new_with_class_style( &syntax, &syntax_set, - ClassStyle::SpacedPrefixed { prefix: "code" }, + ClassStyle::Spaced, ); LinesWithEndings::from(file_string) .for_each(|line| highlighter.parse_html_for_line_which_includes_newline(line)); diff --git a/templates/static/style.css b/templates/static/style.css @@ -34,7 +34,7 @@ body { font-size: .9rem; } -.line { +a.line { display: inline-block; width: 4em; margin-right: .7em;