cleaned up

This commit is contained in:
gyoder 2025-07-05 16:17:58 -06:00
parent 010bb99c9b
commit 88b22b4e77
5 changed files with 35 additions and 61 deletions

View file

@ -1,32 +1,11 @@
use std::env;
use std::fs;
use std::fs::read_to_string;
use std::path::{Path, PathBuf};
use std::str::FromStr;
use htmlua_parser::serve::serve_content;
use kuchikiki::{
NodeRef,
traits::TendrilSink,
};
use std::env;
fn main() {
println!("Content-Type: text/html\n");
let request_uri = env::var("PATH_INFO").unwrap_or_else(|_| "".to_string());
let page = serve_content(request_uri.as_str()).unwrap();
// Output the final expanded HTML
println!("{page}");
}
// Simple HTML escape function
fn html_escape(input: &str) -> String {
input
.replace('&', "&")
.replace('<', "&lt;")
.replace('>', "&gt;")
.replace('"', "&quot;")
.replace('\'', "&#x27;")
}